Home | History | Annotate | Download | only in encoder

Lines Matching refs:ps_entropy

144     entropy_ctxt_t *ps_entropy = &ps_codec->as_process[ctxt_sel * MAX_PROCESS_THREADS].s_entropy;
147 bitstrm_t *ps_bitstrm = ps_entropy->ps_bitstrm;
181 ps_entropy->i4_error_code = IH264E_SUCCESS;
184 ps_entropy->i4_error_code |= ih264e_generate_sps(ps_bitstrm, ps_sps,
188 ps_entropy->i4_error_code |= ih264e_generate_pps(ps_bitstrm, ps_pps, ps_sps);
193 return ps_entropy->i4_error_code;
222 entropy_ctxt_t *ps_entropy = &ps_proc->s_entropy;
225 ps_entropy->i4_mb_start_add = ps_entropy->i4_mb_y * ps_entropy->i4_wd_mbs + ps_entropy->i4_mb_x;
228 ps_entropy->i4_mb_end_add = ps_entropy->i4_mb_start_add + ps_entropy->i4_mb_cnt;
231 ps_entropy->i4_cur_slice_idx = ps_proc->pu1_slice_idx[ps_entropy->i4_mb_start_add];
235 if (ps_entropy->i4_mb_start_add == 0)
237 ps_entropy->i4_sof = 1;
240 if (ps_entropy->i4_mb_x == 0)
243 ps_entropy->pv_mb_coeff_data = ((UWORD8 *)ps_entropy->pv_pic_mb_coeff_data) +
244 ps_entropy->i4_mb_y * ps_codec->u4_size_coeff_data;
247 ps_entropy->pv_mb_header_data = ((UWORD8 *)ps_entropy->pv_pic_mb_header_data) +
248 ps_entropy->i4_mb_y * ps_codec->u4_size_header_data;
282 entropy_ctxt_t *ps_entropy = &ps_proc->s_entropy;
285 cabac_ctxt_t *ps_cabac_ctxt = ps_entropy->ps_cabac;
288 sps_t *ps_sps = ps_entropy->ps_sps_base + (ps_entropy->u4_sps_id % MAX_SPS_CNT);
291 pps_t *ps_pps = ps_entropy->ps_pps_base + (ps_entropy->u4_pps_id % MAX_PPS_CNT);
294 slice_header_t *ps_slice_hdr = ps_entropy->ps_slice_hdr_base + (ps_entropy->i4_cur_slice_idx % MAX_SLICE_HDR_CNT);
300 bitstrm_t *ps_bitstrm = ps_entropy->ps_bitstrm;
323 u4_mb_idx = ps_entropy->i4_mb_start_add;
326 u4_mb_end_idx = ps_entropy->i4_mb_end_add;
329 i4_wd_mbs = ps_entropy->i4_wd_mbs;
332 i4_ht_mbs = ps_entropy->i4_ht_mbs;
338 pu1_proc_map = ps_proc->pu1_proc_map + ps_entropy->i4_mb_y * i4_wd_mbs;
341 pu1_entropy_map_curr = ps_entropy->pu1_entropy_map + ps_entropy->i4_mb_y * i4_wd_mbs;
350 if (ps_entropy->i4_sof)
358 s_out_buf.u4_is_last = ps_entropy->u4_is_last;
361 s_out_buf.u4_timestamp_high = ps_entropy->u4_timestamp_high;
362 s_out_buf.u4_timestamp_low = ps_entropy->u4_timestamp_low;
372 if (1 == ps_entropy->i4_gen_header)
375 ps_entropy->i4_error_code |= ih264e_generate_sps(ps_bitstrm, ps_sps,
378 ps_entropy->i4_error_code |= ih264e_generate_pps(ps_bitstrm, ps_pps, ps_sps);
381 ps_entropy->i4_gen_header = 0;
388 ps_entropy->i4_error_code |= ih264e_generate_slice_header(ps_bitstrm, ps_slice_hdr,
393 ps_entropy->i4_sof = 0;
395 if (CABAC == ps_entropy->u1_entropy_coding_mode_flag)
399 ih264e_init_cabac_ctxt(ps_entropy);
407 if (ps_entropy->i4_mb_x == i4_wd_mbs)
409 ps_entropy->i4_mb_y++;
410 ps_entropy->i4_mb_x = 0;
413 ps_entropy->pv_mb_coeff_data = ((UWORD8 *)ps_entropy->pv_pic_mb_coeff_data) +
414 ps_entropy->i4_mb_y * ps_codec->u4_size_coeff_data;
417 ps_entropy->pv_mb_header_data = ((UWORD8 *)ps_entropy->pv_pic_mb_header_data) +
418 ps_entropy->i4_mb_y * ps_codec->u4_size_header_data;
421 pu1_proc_map = ps_proc->pu1_proc_map + ps_entropy->i4_mb_y * i4_wd_mbs;
424 pu1_entropy_map_curr = ps_entropy->pu1_entropy_map + ps_entropy->i4_mb_y * i4_wd_mbs;
427 DEBUG("\nmb indices x, y %d, %d", ps_entropy->i4_mb_x, ps_entropy->i4_mb_y);
428 ENTROPY_TRACE("mb index x %d", ps_entropy->i4_mb_x);
429 ENTROPY_TRACE("mb index y %d", ps_entropy->i4_mb_y);
438 WORD32 idx = ps_entropy->i4_mb_x;
448 ps_entropy->i4_error_code |= ps_codec->pf_write_mb_syntax_layer[ps_entropy->u1_entropy_coding_mode_flag][i4_slice_type](ps_entropy);
453 pu1_entropy_map_curr[ps_entropy->i4_mb_x] = 1;
456 ps_entropy->i4_mb_x++;
458 if (CABAC == ps_entropy->u1_entropy_coding_mode_flag)
460 if (ps_entropy->i4_mb_x < i4_wd_mbs)
466 if (ps_entropy->i4_mb_x == i4_wd_mbs)
472 WORD32 i4_curr_slice_idx = ps_entropy->i4_cur_slice_idx;
475 UWORD8 *pu1_slice_idx = ps_entropy->pu1_slice_idx;
483 if (CAVLC == ps_entropy->u1_entropy_coding_mode_flag)
486 && *ps_entropy->pi4_mb_skip_run)
488 if (*ps_entropy->pi4_mb_skip_run)
490 PUT_BITS_UEV(ps_bitstrm, *ps_entropy->pi4_mb_skip_run, ps_entropy->i4_error_code, "mb skip run");
491 *ps_entropy->pi4_mb_skip_run = 0;
495 ps_entropy->i4_error_code |= ih264e_put_rbsp_trailing_bits(ps_bitstrm);
504 ps_entropy->i4_cur_slice_idx = i4_curr_slice_idx;
505 ps_slice_hdr = ps_entropy->ps_slice_hdr_base+ (i4_curr_slice_idx % MAX_SLICE_HDR_CNT);
508 ps_entropy->i4_mb_start_add = u4_mb_idx;
513 ps_entropy->i4_error_code |= ih264e_generate_slice_header(
515 if (CABAC == ps_entropy->u1_entropy_coding_mode_flag)
519 ih264e_init_cabac_ctxt(ps_entropy);
524 if (CABAC == ps_entropy->u1_entropy_coding_mode_flag
537 ps_entropy->u4_header_bits[i4_slice_type == PSLICE] +=
545 ps_entropy->i4_eof = 1;
549 if (CABAC == ps_entropy->u1_entropy_coding_mode_flag
557 if (ps_entropy->i4_eof)
559 if (CAVLC == ps_entropy->u1_entropy_coding_mode_flag)
562 if ((i4_slice_type != ISLICE) && *ps_entropy->pi4_mb_skip_run)
564 if (*ps_entropy->pi4_mb_skip_run)
566 PUT_BITS_UEV(ps_bitstrm, *ps_entropy->pi4_mb_skip_run,
567 ps_entropy->i4_error_code, "mb skip run");
568 *ps_entropy->pi4_mb_skip_run = 0;
572 ps_entropy->i4_error_code |= ih264e_put_rbsp_trailing_bits(ps_bitstrm);
592 ps_entropy->ps_bitstrm->u4_strm_buf_offset = 0;
597 ps_entropy->i4_error_code |= ih264e_add_filler_nal_unit(ps_bitstrm, i4_stuff_bytes);
615 ps_entropy->ps_bitstrm->u4_strm_buf_offset;
617 DEBUG("entropy status %x", ps_entropy->i4_error_code);
623 return ps_entropy->i4_error_code;