Lines Matching defs:sliceHdr
319 AVCSliceHeader *sliceHdr = video->sliceHdr;
328 status = ue_v(stream, sliceHdr->first_mb_in_slice);
334 status = ue_v(stream, sliceHdr->slice_type);
341 status = ue_v(stream, sliceHdr->pic_parameter_set_id);
343 status = BitstreamWriteBits(stream, currSPS->log2_max_frame_num_minus4 + 4, sliceHdr->frame_num);
353 status = ue_v(stream, sliceHdr->idr_pic_id);
359 sliceHdr->pic_order_cnt_lsb);
361 if (currPPS->pic_order_present_flag && !sliceHdr->field_pic_flag)
363 status = se_v(stream, sliceHdr->delta_pic_order_cnt_bottom); /* 32 bits */
368 status = se_v(stream, sliceHdr->delta_pic_order_cnt[0]); /* 32 bits */
369 if (currPPS->pic_order_present_flag && !sliceHdr->field_pic_flag)
371 status = se_v(stream, sliceHdr->delta_pic_order_cnt[1]); /* 32 bits */
377 status = ue_v(stream, sliceHdr->redundant_pic_cnt);
382 status = BitstreamWrite1Bit(stream, sliceHdr->direct_spatial_mv_pred_flag);
392 status = BitstreamWrite1Bit(stream, sliceHdr->num_ref_idx_active_override_flag);
393 if (sliceHdr->num_ref_idx_active_override_flag)
396 status = ue_v(stream, sliceHdr->num_ref_idx_l0_active_minus1);
399 status = ue_v(stream, sliceHdr->num_ref_idx_l1_active_minus1);
409 status = ref_pic_list_reordering(video, stream, sliceHdr, slice_type);
424 status = dec_ref_pic_marking(video, stream, sliceHdr);
434 /* ue_v(stream,&(sliceHdr->cabac_init_idc));
435 if(sliceHdr->cabac_init_idc > 2){
440 status = se_v(stream, sliceHdr->slice_qp_delta);
450 status = BitstreamWrite1Bit(stream, sliceHdr->sp_for_switch_flag);
456 status = se_v(stream, sliceHdr->slice_qs_delta);
466 status = ue_v(stream, sliceHdr->disable_deblocking_filter_idc);
468 if (sliceHdr->disable_deblocking_filter_idc != 1)
470 status = se_v(stream, sliceHdr->slice_alpha_c0_offset_div2);
472 status = se_v(stream, sliceHdr->slice_beta_offset_div_2);
496 BitstreamWriteBits(stream, i, sliceHdr->slice_group_change_cycle);
506 AVCEnc_Status ref_pic_list_reordering(AVCCommonObj *video, AVCEncBitstream *stream, AVCSliceHeader *sliceHdr, int slice_type)
514 status = BitstreamWrite1Bit(stream, sliceHdr->ref_pic_list_reordering_flag_l0);
515 if (sliceHdr->ref_pic_list_reordering_flag_l0)
520 status = ue_v(stream, sliceHdr->reordering_of_pic_nums_idc_l0[i]);
521 if (sliceHdr->reordering_of_pic_nums_idc_l0[i] == 0 ||
522 sliceHdr->reordering_of_pic_nums_idc_l0[i] == 1)
524 status = ue_v(stream, sliceHdr->abs_diff_pic_num_minus1_l0[i]);
526 /*if(sliceHdr->reordering_of_pic_nums_idc_l0[i] == 0 &&
527 sliceHdr->abs_diff_pic_num_minus1_l0[i] > video->MaxPicNum/2 -1)
531 if(sliceHdr->reordering_of_pic_nums_idc_l0[i] == 1 &&
532 sliceHdr->abs_diff_pic_num_minus1_l0[i] > video->MaxPicNum/2 -2)
537 else if (sliceHdr->reordering_of_pic_nums_idc_l0[i] == 2)
539 status = ue_v(stream, sliceHdr->long_term_pic_num_l0[i]);
543 while (sliceHdr->reordering_of_pic_nums_idc_l0[i] != 3
544 && i <= (int)sliceHdr->num_ref_idx_l0_active_minus1 + 1) ;
549 status = BitstreamWrite1Bit(stream, sliceHdr->ref_pic_list_reordering_flag_l1);
550 if (sliceHdr->ref_pic_list_reordering_flag_l1)
555 status = ue_v(stream, sliceHdr->reordering_of_pic_nums_idc_l1[i]);
556 if (sliceHdr->reordering_of_pic_nums_idc_l1[i] == 0 ||
557 sliceHdr->reordering_of_pic_nums_idc_l1[i] == 1)
559 status = ue_v(stream, sliceHdr->abs_diff_pic_num_minus1_l1[i]);
561 if(sliceHdr->reordering_of_pic_nums_idc_l1[i] == 0 &&
562 sliceHdr->abs_diff_pic_num_minus1_l1[i] > video->MaxPicNum/2 -1)
566 if(sliceHdr->reordering_of_pic_nums_idc_l1[i] == 1 &&
567 sliceHdr->abs_diff_pic_num_minus1_l1[i] > video->MaxPicNum/2 -2)
572 else if (sliceHdr->reordering_of_pic_nums_idc_l1[i] == 2)
574 status = ue_v(stream, sliceHdr->long_term_pic_num_l1[i]);
578 while (sliceHdr->reordering_of_pic_nums_idc_l1[i] != 3
579 && i <= (int)sliceHdr->num_ref_idx_l1_active_minus1 + 1) ;
587 AVCEnc_Status dec_ref_pic_marking(AVCCommonObj *video, AVCEncBitstream *stream, AVCSliceHeader *sliceHdr)
594 status = BitstreamWrite1Bit(stream, sliceHdr->no_output_of_prior_pics_flag);
595 status = BitstreamWrite1Bit(stream, sliceHdr->long_term_reference_flag);
596 if (sliceHdr->long_term_reference_flag == 0) /* used for short-term */
608 status = BitstreamWrite1Bit(stream, sliceHdr->adaptive_ref_pic_marking_mode_flag); /* default to zero */
609 if (sliceHdr->adaptive_ref_pic_marking_mode_flag)
614 status = ue_v(stream, sliceHdr->memory_management_control_operation[i]);
615 if (sliceHdr->memory_management_control_operation[i] == 1 ||
616 sliceHdr->memory_management_control_operation[i] == 3)
618 status = ue_v(stream, sliceHdr->difference_of_pic_nums_minus1[i]);
620 if (sliceHdr->memory_management_control_operation[i] == 2)
622 status = ue_v(stream, sliceHdr->long_term_pic_num[i]);
624 if (sliceHdr->memory_management_control_operation[i] == 3 ||
625 sliceHdr->memory_management_control_operation[i] == 6)
627 status = ue_v(stream, sliceHdr->long_term_frame_idx[i]);
629 if (sliceHdr->memory_management_control_operation[i] == 4)
631 status = ue_v(stream, sliceHdr->max_long_term_frame_idx_plus1[i]);
635 while (sliceHdr->memory_management_control_operation[i] != 0 && i < MAX_DEC_REF_PIC_MARKING);
636 if (i >= MAX_DEC_REF_PIC_MARKING && sliceHdr->memory_management_control_operation[i] != 0)
652 AVCSliceHeader *sliceHdr = video->sliceHdr;
668 sliceHdr->pic_order_cnt_lsb = currInput->disp_order - encvid->dispOrdPOCRef;
669 while (sliceHdr->pic_order_cnt_lsb >= video->MaxPicOrderCntLsb)
671 sliceHdr->pic_order_cnt_lsb -= video->MaxPicOrderCntLsb;
680 if (sliceHdr->pic_order_cnt_lsb < video->prevPicOrderCntLsb &&
681 (video->prevPicOrderCntLsb - sliceHdr->pic_order_cnt_lsb) >= (video->MaxPicOrderCntLsb / 2))
683 else if (sliceHdr->pic_order_cnt_lsb > video->prevPicOrderCntLsb &&
684 (sliceHdr->pic_order_cnt_lsb - video->prevPicOrderCntLsb) > (video->MaxPicOrderCntLsb / 2))
690 if (!sliceHdr->field_pic_flag || !sliceHdr->bottom_field_flag)
692 video->PicOrderCnt = video->TopFieldOrderCnt = video->PicOrderCntMsb + sliceHdr->pic_order_cnt_lsb;
695 if (!sliceHdr->field_pic_flag)
697 video->BottomFieldOrderCnt = video->TopFieldOrderCnt + sliceHdr->delta_pic_order_cnt_bottom;
699 else if (sliceHdr->bottom_field_flag)
701 video->PicOrderCnt = video->BottomFieldOrderCnt = video->PicOrderCntMsb + sliceHdr->pic_order_cnt_lsb;
704 if (!sliceHdr->field_pic_flag)
709 if (video->currPicParams->pic_order_present_flag && !sliceHdr->field_pic_flag)
711 sliceHdr->delta_pic_order_cnt_bottom = 0; /* defaulted to zero */
723 else if (video->prevFrameNum > sliceHdr->frame_num)
734 video->absFrameNum = video->FrameNumOffset + sliceHdr->frame_num;
780 sliceHdr->delta_pic_order_cnt[0] = currInput->disp_order - encvid->dispOrdPOCRef - video->expectedPicOrderCnt;
782 if (video->currPicParams->pic_order_present_flag && !sliceHdr->field_pic_flag)
784 sliceHdr->delta_pic_order_cnt[1] = sliceHdr->delta_pic_order_cnt[0]; /* should be calculated from currInput->bottom_field->disp_order */
788 sliceHdr->delta_pic_order_cnt[1] = 0;
793 sliceHdr->delta_pic_order_cnt[0] = sliceHdr->delta_pic_order_cnt[1] = 0;
796 if (sliceHdr->field_pic_flag == 0)
798 video->TopFieldOrderCnt = video->expectedPicOrderCnt + sliceHdr->delta_pic_order_cnt[0];
799 video->BottomFieldOrderCnt = video->TopFieldOrderCnt + currSPS->offset_for_top_to_bottom_field + sliceHdr->delta_pic_order_cnt[1];
803 else if (sliceHdr->bottom_field_flag == 0)
805 video->TopFieldOrderCnt = video->expectedPicOrderCnt + sliceHdr->delta_pic_order_cnt[0];
810 video->BottomFieldOrderCnt = video->expectedPicOrderCnt + currSPS->offset_for_top_to_bottom_field + sliceHdr->delta_pic_order_cnt[0];
838 else if (video->prevFrameNum > sliceHdr->frame_num)
853 video->PicOrderCnt = 2 * (video->FrameNumOffset + sliceHdr->frame_num) - 1;
857 video->PicOrderCnt = 2 * (video->FrameNumOffset + sliceHdr->frame_num);
860 if (sliceHdr->field_pic_flag == 0)
864 else if (sliceHdr->bottom_field_flag)
883 AVCSliceHeader *sliceHdr = video->sliceHdr;
886 video->prevFrameNum = sliceHdr->frame_num;
899 video->prevPicOrderCntLsb = sliceHdr->pic_order_cnt_lsb;