438
438
h->topright_samples_available = 0xFFFF;
440
440
if (mb_type == 0) { /* SKIP */
441
if (s->pict_type == FF_P_TYPE || s->next_picture.mb_type[mb_xy] == -1) {
441
if (s->pict_type == AV_PICTURE_TYPE_P || s->next_picture.mb_type[mb_xy] == -1) {
442
442
svq3_mc_dir_part(s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0, 0, 0, 0);
444
if (s->pict_type == FF_B_TYPE) {
444
if (s->pict_type == AV_PICTURE_TYPE_B) {
445
445
svq3_mc_dir_part(s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0, 0, 1, 1);
503
503
memset(&h->ref_cache[m][scan8[0] - 1*8 - 1], PART_NOT_AVAILABLE, 8);
505
if (s->pict_type != FF_B_TYPE)
505
if (s->pict_type != AV_PICTURE_TYPE_B)
509
509
/* decode motion vector(s) and form prediction(s) */
510
if (s->pict_type == FF_P_TYPE) {
510
if (s->pict_type == AV_PICTURE_TYPE_P) {
511
511
if (svq3_mc_dir(h, (mb_type - 1), mode, 0, 0) < 0)
513
} else { /* FF_B_TYPE */
513
} else { /* AV_PICTURE_TYPE_B */
514
514
if (mb_type != 2) {
515
515
if (svq3_mc_dir(h, 0, mode, 0, 0) < 0)
609
609
mb_type = MB_TYPE_INTRA16x16;
612
if (!IS_INTER(mb_type) && s->pict_type != FF_I_TYPE) {
612
if (!IS_INTER(mb_type) && s->pict_type != AV_PICTURE_TYPE_I) {
613
613
for (i = 0; i < 4; i++) {
614
614
memset(s->current_picture.motion_val[0][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
616
if (s->pict_type == FF_B_TYPE) {
616
if (s->pict_type == AV_PICTURE_TYPE_B) {
617
617
for (i = 0; i < 4; i++) {
618
618
memset(s->current_picture.motion_val[1][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
622
622
if (!IS_INTRA4x4(mb_type)) {
623
623
memset(h->intra4x4_pred_mode+h->mb2br_xy[mb_xy], DC_PRED, 8);
625
if (!IS_SKIP(mb_type) || s->pict_type == FF_B_TYPE) {
625
if (!IS_SKIP(mb_type) || s->pict_type == AV_PICTURE_TYPE_B) {
626
626
memset(h->non_zero_count_cache + 8, 0, 4*9*sizeof(uint8_t));
627
627
s->dsp.clear_blocks(h->mb);
630
if (!IS_INTRA16x16(mb_type) && (!IS_SKIP(mb_type) || s->pict_type == FF_B_TYPE)) {
630
if (!IS_INTRA16x16(mb_type) && (!IS_SKIP(mb_type) || s->pict_type == AV_PICTURE_TYPE_B)) {
631
631
if ((vlc = svq3_get_ue_golomb(&s->gb)) >= 48){
632
632
av_log(h->s.avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc);
636
636
cbp = IS_INTRA(mb_type) ? golomb_to_intra4x4_cbp[vlc] : golomb_to_inter_cbp[vlc];
638
if (IS_INTRA16x16(mb_type) || (s->pict_type != FF_I_TYPE && s->adaptive_quant && cbp)) {
638
if (IS_INTRA16x16(mb_type) || (s->pict_type != AV_PICTURE_TYPE_I && s->adaptive_quant && cbp)) {
639
639
s->qscale += svq3_get_se_golomb(&s->gb);
641
641
if (s->qscale > 31){
942
942
if (avctx->debug&FF_DEBUG_PICT_INFO){
943
943
av_log(h->s.avctx, AV_LOG_DEBUG, "%c hpel:%d, tpel:%d aqp:%d qp:%d, slice_num:%02X\n",
944
av_get_pict_type_char(s->pict_type), h->halfpel_flag, h->thirdpel_flag,
944
av_get_picture_type_char(s->pict_type), h->halfpel_flag, h->thirdpel_flag,
945
945
s->adaptive_quant, s->qscale, h->slice_num);
948
948
/* for skipping the frame */
949
949
s->current_picture.pict_type = s->pict_type;
950
s->current_picture.key_frame = (s->pict_type == FF_I_TYPE);
950
s->current_picture.key_frame = (s->pict_type == AV_PICTURE_TYPE_I);
952
952
/* Skip B-frames if we do not have reference frames. */
953
if (s->last_picture_ptr == NULL && s->pict_type == FF_B_TYPE)
956
/* Skip B-frames if we are in a hurry. */
957
if (avctx->hurry_up && s->pict_type == FF_B_TYPE)
959
/* Skip everything if we are in a hurry >= 5. */
960
if (avctx->hurry_up >= 5)
963
if ( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE)
964
||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE)
953
if (s->last_picture_ptr == NULL && s->pict_type == AV_PICTURE_TYPE_B)
955
if ( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B)
956
||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I)
965
957
|| avctx->skip_frame >= AVDISCARD_ALL)
968
960
if (s->next_p_frame_damaged) {
969
if (s->pict_type == FF_B_TYPE)
961
if (s->pict_type == AV_PICTURE_TYPE_B)
972
964
s->next_p_frame_damaged = 0;
975
967
if (ff_h264_frame_start(h) < 0)
978
if (s->pict_type == FF_B_TYPE) {
970
if (s->pict_type == AV_PICTURE_TYPE_B) {
979
971
h->frame_num_offset = (h->slice_num - h->prev_frame_num);
981
973
if (h->frame_num_offset < 0) {
1025
1017
mb_type = svq3_get_ue_golomb(&s->gb);
1027
if (s->pict_type == FF_I_TYPE) {
1019
if (s->pict_type == AV_PICTURE_TYPE_I) {
1029
} else if (s->pict_type == FF_B_TYPE && mb_type >= 4) {
1021
} else if (s->pict_type == AV_PICTURE_TYPE_B && mb_type >= 4) {
1032
1024
if (mb_type > 33 || svq3_decode_mb(h, mb_type)) {
1038
1030
ff_h264_hl_decode_mb (h);
1041
if (s->pict_type != FF_B_TYPE && !s->low_delay) {
1033
if (s->pict_type != AV_PICTURE_TYPE_B && !s->low_delay) {
1042
1034
s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride] =
1043
(s->pict_type == FF_P_TYPE && mb_type < 8) ? (mb_type - 1) : -1;
1035
(s->pict_type == AV_PICTURE_TYPE_P && mb_type < 8) ? (mb_type - 1) : -1;
1050
1042
MPV_frame_end(s);
1052
if (s->pict_type == FF_B_TYPE || s->low_delay) {
1044
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
1053
1045
*(AVFrame *) data = *(AVFrame *) &s->current_picture;
1055
1047
*(AVFrame *) data = *(AVFrame *) &s->last_picture;