Lines Matching +full:- +full:s
6 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
76 void ff_h263_show_pict_info(MpegEncContext *s){ in ff_h263_show_pict_info() argument
77 if(s->avctx->debug&FF_DEBUG_PICT_INFO){ in ff_h263_show_pict_info()
78 av_log(s->avctx, AV_LOG_DEBUG, "qp:%d %c size:%d rnd:%d%s%s%s%s%s%s%s%s%s %d/%d\n", in ff_h263_show_pict_info()
79 s->qscale, av_get_picture_type_char(s->pict_type), in ff_h263_show_pict_info()
80 s->gb.size_in_bits, 1-s->no_rounding, in ff_h263_show_pict_info()
81 s->obmc ? " AP" : "", in ff_h263_show_pict_info()
82 s->umvplus ? " UMV" : "", in ff_h263_show_pict_info()
83 s->h263_long_vectors ? " LONG" : "", in ff_h263_show_pict_info()
84 s->h263_plus ? " +" : "", in ff_h263_show_pict_info()
85 s->h263_aic ? " AIC" : "", in ff_h263_show_pict_info()
86 s->alt_inter_vlc ? " AIV" : "", in ff_h263_show_pict_info()
87 s->modified_quant ? " MQ" : "", in ff_h263_show_pict_info()
88 s->loop_filter ? " LOOP" : "", in ff_h263_show_pict_info()
89 s->h263_slice_structured ? " SS" : "", in ff_h263_show_pict_info()
90 s->avctx->framerate.num, s->avctx->framerate.den in ff_h263_show_pict_info()
138 int ff_h263_decode_mba(MpegEncContext *s) in ff_h263_decode_mba() argument
143 if (s->mb_num - 1 <= ff_mba_max[i]) in ff_h263_decode_mba()
145 mb_pos = get_bits(&s->gb, ff_mba_length[i]); in ff_h263_decode_mba()
146 s->mb_x = mb_pos % s->mb_width; in ff_h263_decode_mba()
147 s->mb_y = mb_pos / s->mb_width; in ff_h263_decode_mba()
156 static int h263_decode_gob_header(MpegEncContext *s) in h263_decode_gob_header() argument
162 val = show_bits(&s->gb, 16); in h263_decode_gob_header()
164 return -1; in h263_decode_gob_header()
167 skip_bits(&s->gb, 16); /* Drop the zeros */ in h263_decode_gob_header()
168 left= get_bits_left(&s->gb); in h263_decode_gob_header()
171 for(;left>13; left--){ in h263_decode_gob_header()
172 if(get_bits1(&s->gb)) break; /* Seek the '1' bit */ in h263_decode_gob_header()
175 return -1; in h263_decode_gob_header()
177 if(s->h263_slice_structured){ in h263_decode_gob_header()
178 if(check_marker(s->avctx, &s->gb, "before MBA")==0) in h263_decode_gob_header()
179 return -1; in h263_decode_gob_header()
181 ff_h263_decode_mba(s); in h263_decode_gob_header()
183 if(s->mb_num > 1583) in h263_decode_gob_header()
184 if(check_marker(s->avctx, &s->gb, "after MBA")==0) in h263_decode_gob_header()
185 return -1; in h263_decode_gob_header()
187 s->qscale = get_bits(&s->gb, 5); /* SQUANT */ in h263_decode_gob_header()
188 if(check_marker(s->avctx, &s->gb, "after SQUANT")==0) in h263_decode_gob_header()
189 return -1; in h263_decode_gob_header()
190 skip_bits(&s->gb, 2); /* GFID */ in h263_decode_gob_header()
192 gob_number = get_bits(&s->gb, 5); /* GN */ in h263_decode_gob_header()
193 s->mb_x= 0; in h263_decode_gob_header()
194 s->mb_y= s->gob_index* gob_number; in h263_decode_gob_header()
195 skip_bits(&s->gb, 2); /* GFID */ in h263_decode_gob_header()
196 s->qscale = get_bits(&s->gb, 5); /* GQUANT */ in h263_decode_gob_header()
199 if(s->mb_y >= s->mb_height) in h263_decode_gob_header()
200 return -1; in h263_decode_gob_header()
202 if(s->qscale==0) in h263_decode_gob_header()
203 return -1; in h263_decode_gob_header()
209 * Decode the group of blocks / video packet header / slice header (MPEG-4 Studio).
212 int ff_h263_resync(MpegEncContext *s){ in ff_h263_resync() argument
215 /* In MPEG-4 studio mode look for a new slice startcode in ff_h263_resync()
217 if(s->codec_id==AV_CODEC_ID_MPEG4 && s->studio_profile) { in ff_h263_resync()
218 align_get_bits(&s->gb); in ff_h263_resync()
220 while (get_bits_left(&s->gb) >= 32 && show_bits_long(&s->gb, 32) != SLICE_START_CODE) { in ff_h263_resync()
221 get_bits(&s->gb, 8); in ff_h263_resync()
224 if (get_bits_left(&s->gb) >= 32 && show_bits_long(&s->gb, 32) == SLICE_START_CODE) in ff_h263_resync()
225 return get_bits_count(&s->gb); in ff_h263_resync()
227 return -1; in ff_h263_resync()
230 if(s->codec_id==AV_CODEC_ID_MPEG4){ in ff_h263_resync()
231 skip_bits1(&s->gb); in ff_h263_resync()
232 align_get_bits(&s->gb); in ff_h263_resync()
235 if(show_bits(&s->gb, 16)==0){ in ff_h263_resync()
236 pos= get_bits_count(&s->gb); in ff_h263_resync()
237 if(CONFIG_MPEG4_DECODER && s->codec_id==AV_CODEC_ID_MPEG4) in ff_h263_resync()
238 ret= ff_mpeg4_decode_video_packet_header(s->avctx->priv_data); in ff_h263_resync()
240 ret= h263_decode_gob_header(s); in ff_h263_resync()
244 //OK, it's not where it is supposed to be ... in ff_h263_resync()
245 s->gb= s->last_resync_gb; in ff_h263_resync()
246 align_get_bits(&s->gb); in ff_h263_resync()
247 left= get_bits_left(&s->gb); in ff_h263_resync()
249 for(;left>16+1+5+5; left-=8){ in ff_h263_resync()
250 if(show_bits(&s->gb, 16)==0){ in ff_h263_resync()
251 GetBitContext bak= s->gb; in ff_h263_resync()
253 pos= get_bits_count(&s->gb); in ff_h263_resync()
254 if(CONFIG_MPEG4_DECODER && s->codec_id==AV_CODEC_ID_MPEG4) in ff_h263_resync()
255 ret= ff_mpeg4_decode_video_packet_header(s->avctx->priv_data); in ff_h263_resync()
257 ret= h263_decode_gob_header(s); in ff_h263_resync()
261 s->gb= bak; in ff_h263_resync()
263 skip_bits(&s->gb, 8); in ff_h263_resync()
266 return -1; in ff_h263_resync()
269 int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code) in ff_h263_decode_motion() argument
272 code = get_vlc2(&s->gb, ff_h263_mv_vlc.table, H263_MV_VLC_BITS, 2); in ff_h263_decode_motion()
279 sign = get_bits1(&s->gb); in ff_h263_decode_motion()
280 shift = f_code - 1; in ff_h263_decode_motion()
283 val = (val - 1) << shift; in ff_h263_decode_motion()
284 val |= get_bits(&s->gb, shift); in ff_h263_decode_motion()
288 val = -val; in ff_h263_decode_motion()
292 if (!s->h263_long_vectors) { in ff_h263_decode_motion()
296 if (pred < -31 && val < -63) in ff_h263_decode_motion()
299 val -= 64; in ff_h263_decode_motion()
307 static int h263p_decode_umotion(MpegEncContext * s, int pred) in h263p_decode_umotion() argument
311 if (get_bits1(&s->gb)) /* Motion difference = 0 */ in h263p_decode_umotion()
314 code = 2 + get_bits1(&s->gb); in h263p_decode_umotion()
316 while (get_bits1(&s->gb)) in h263p_decode_umotion()
319 code += get_bits1(&s->gb); in h263p_decode_umotion()
321 avpriv_request_sample(s->avctx, "Huge DMV"); in h263p_decode_umotion()
328 code = (sign) ? (pred - code) : (pred + code); in h263p_decode_umotion()
329 ff_tlog(s->avctx,"H.263+ UMV Motion = %d\n", code); in h263p_decode_umotion()
337 static void preview_obmc(MpegEncContext *s){ in preview_obmc() argument
338 GetBitContext gb= s->gb; in preview_obmc()
342 const int xy= s->mb_x + 1 + s->mb_y * s->mb_stride; in preview_obmc()
343 const int stride= s->b8_stride*2; in preview_obmc()
346 s->block_index[i]+= 2; in preview_obmc()
348 s->block_index[i]+= 1; in preview_obmc()
349 s->mb_x++; in preview_obmc()
351 av_assert2(s->pict_type == AV_PICTURE_TYPE_P); in preview_obmc()
354 if (get_bits1(&s->gb)) { in preview_obmc()
356 mot_val = s->current_picture.motion_val[0][s->block_index[0]]; in preview_obmc()
362 s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; in preview_obmc()
365 cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); in preview_obmc()
369 s->current_picture.mb_type[xy] = MB_TYPE_INTRA; in preview_obmc()
371 get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); in preview_obmc()
373 if(s->modified_quant){ in preview_obmc()
374 if(get_bits1(&s->gb)) skip_bits(&s->gb, 1); in preview_obmc()
375 else skip_bits(&s->gb, 5); in preview_obmc()
377 skip_bits(&s->gb, 2); in preview_obmc()
381 s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; in preview_obmc()
383 mot_val= ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); in preview_obmc()
384 if (s->umvplus) in preview_obmc()
385 mx = h263p_decode_umotion(s, pred_x); in preview_obmc()
387 mx = ff_h263_decode_motion(s, pred_x, 1); in preview_obmc()
389 if (s->umvplus) in preview_obmc()
390 my = h263p_decode_umotion(s, pred_y); in preview_obmc()
392 my = ff_h263_decode_motion(s, pred_y, 1); in preview_obmc()
399 s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; in preview_obmc()
401 mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); in preview_obmc()
402 if (s->umvplus) in preview_obmc()
403 mx = h263p_decode_umotion(s, pred_x); in preview_obmc()
405 mx = ff_h263_decode_motion(s, pred_x, 1); in preview_obmc()
407 if (s->umvplus) in preview_obmc()
408 my = h263p_decode_umotion(s, pred_y); in preview_obmc()
410 my = ff_h263_decode_motion(s, pred_y, 1); in preview_obmc()
411 if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) in preview_obmc()
412 skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ in preview_obmc()
421 s->block_index[i]-= 2; in preview_obmc()
423 s->block_index[i]-= 1; in preview_obmc()
424 s->mb_x--; in preview_obmc()
426 s->gb= gb; in preview_obmc()
429 static void h263_decode_dquant(MpegEncContext *s){ in h263_decode_dquant() argument
430 static const int8_t quant_tab[4] = { -1, -2, 1, 2 }; in h263_decode_dquant()
432 if(s->modified_quant){ in h263_decode_dquant()
433 if(get_bits1(&s->gb)) in h263_decode_dquant()
434 s->qscale= ff_modified_quant_tab[get_bits1(&s->gb)][ s->qscale ]; in h263_decode_dquant()
436 s->qscale= get_bits(&s->gb, 5); in h263_decode_dquant()
438 s->qscale += quant_tab[get_bits(&s->gb, 2)]; in h263_decode_dquant()
439 ff_set_qscale(s, s->qscale); in h263_decode_dquant()
442 static int h263_decode_block(MpegEncContext * s, int16_t * block, in h263_decode_block() argument
448 GetBitContext gb= s->gb; in h263_decode_block()
450 scan_table = s->intra_scantable.permutated; in h263_decode_block()
451 if (s->h263_aic && s->mb_intra) { in h263_decode_block()
454 if (s->ac_pred) { in h263_decode_block()
455 if (s->h263_aic_dir) in h263_decode_block()
456 scan_table = s->intra_v_scantable.permutated; /* left */ in h263_decode_block()
458 scan_table = s->intra_h_scantable.permutated; /* top */ in h263_decode_block()
460 } else if (s->mb_intra) { in h263_decode_block()
462 if (CONFIG_RV10_DECODER && s->codec_id == AV_CODEC_ID_RV10) { in h263_decode_block()
463 if (s->rv10_version == 3 && s->pict_type == AV_PICTURE_TYPE_I) { in h263_decode_block()
465 component = (n <= 3 ? 0 : n - 4 + 1); in h263_decode_block()
466 level = s->last_dc[component]; in h263_decode_block()
467 if (s->rv10_first_dc_coded[component]) { in h263_decode_block()
468 diff = ff_rv_decode_dc(s, n); in h263_decode_block()
470 return -1; in h263_decode_block()
473 s->last_dc[component] = level; in h263_decode_block()
475 s->rv10_first_dc_coded[component] = 1; in h263_decode_block()
478 level = get_bits(&s->gb, 8); in h263_decode_block()
483 level = get_bits(&s->gb, 8); in h263_decode_block()
485 av_log(s->avctx, AV_LOG_ERROR, "illegal dc %d at %d %d\n", level, s->mb_x, s->mb_y); in h263_decode_block()
486 if (s->avctx->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT)) in h263_decode_block()
487 return -1; in h263_decode_block()
498 if (s->mb_intra && s->h263_aic) in h263_decode_block()
500 s->block_last_index[n] = i - 1; in h263_decode_block()
505 OPEN_READER(re, &s->gb); in h263_decode_block()
506 i--; // offset by -1 to allow direct indexing of scan_table in h263_decode_block()
508 UPDATE_CACHE(re, &s->gb); in h263_decode_block()
509 GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); in h263_decode_block()
512 CLOSE_READER(re, &s->gb); in h263_decode_block()
513 av_log(s->avctx, AV_LOG_ERROR, "illegal ac vlc code at %dx%d\n", s->mb_x, s->mb_y); in h263_decode_block()
514 return -1; in h263_decode_block()
517 if (CONFIG_FLV_DECODER && s->h263_flv > 1) { in h263_decode_block()
518 int is11 = SHOW_UBITS(re, &s->gb, 1); in h263_decode_block()
519 SKIP_CACHE(re, &s->gb, 1); in h263_decode_block()
520 run = SHOW_UBITS(re, &s->gb, 7) + 1; in h263_decode_block()
522 SKIP_COUNTER(re, &s->gb, 1 + 7); in h263_decode_block()
523 UPDATE_CACHE(re, &s->gb); in h263_decode_block()
524 level = SHOW_SBITS(re, &s->gb, 11); in h263_decode_block()
525 SKIP_COUNTER(re, &s->gb, 11); in h263_decode_block()
527 SKIP_CACHE(re, &s->gb, 7); in h263_decode_block()
528 level = SHOW_SBITS(re, &s->gb, 7); in h263_decode_block()
529 SKIP_COUNTER(re, &s->gb, 1 + 7 + 7); in h263_decode_block()
532 run = SHOW_UBITS(re, &s->gb, 7) + 1; in h263_decode_block()
533 SKIP_CACHE(re, &s->gb, 7); in h263_decode_block()
534 level = (int8_t)SHOW_UBITS(re, &s->gb, 8); in h263_decode_block()
535 SKIP_COUNTER(re, &s->gb, 7 + 8); in h263_decode_block()
536 if(level == -128){ in h263_decode_block()
537 UPDATE_CACHE(re, &s->gb); in h263_decode_block()
538 if (s->codec_id == AV_CODEC_ID_RV10) { in h263_decode_block()
540 level = SHOW_SBITS(re, &s->gb, 12); in h263_decode_block()
541 SKIP_COUNTER(re, &s->gb, 12); in h263_decode_block()
543 level = SHOW_UBITS(re, &s->gb, 5); in h263_decode_block()
544 SKIP_CACHE(re, &s->gb, 5); in h263_decode_block()
545 level |= SHOW_SBITS(re, &s->gb, 6) * (1<<5); in h263_decode_block()
546 SKIP_COUNTER(re, &s->gb, 5 + 6); in h263_decode_block()
551 if (SHOW_UBITS(re, &s->gb, 1)) in h263_decode_block()
552 level = -level; in h263_decode_block()
553 SKIP_COUNTER(re, &s->gb, 1); in h263_decode_block()
557 CLOSE_READER(re, &s->gb); in h263_decode_block()
558 // redo update without last flag, revert -1 offset in h263_decode_block()
559 i = i - run + ((run-1)&63) + 1; in h263_decode_block()
565 if(s->alt_inter_vlc && rl == &ff_h263_rl_inter && !s->mb_intra){ in h263_decode_block()
566 //Looks like a hack but no, it's the way it is supposed to work ... in h263_decode_block()
569 s->gb= gb; in h263_decode_block()
570 s->bdsp.clear_block(block); in h263_decode_block()
573 … av_log(s->avctx, AV_LOG_ERROR, "run overflow at %dx%d i:%d\n", s->mb_x, s->mb_y, s->mb_intra); in h263_decode_block()
574 return -1; in h263_decode_block()
581 if (s->mb_intra && s->h263_aic) { in h263_decode_block()
582 ff_h263_pred_acdc(s, block, n); in h263_decode_block()
585 s->block_last_index[n] = i; in h263_decode_block()
589 static int h263_skip_b_part(MpegEncContext *s, int cbp) in h263_skip_b_part() argument
595 /* we have to set s->mb_intra to zero to decode B-part of PB-frame correctly in h263_skip_b_part()
598 mbi = s->mb_intra; in h263_skip_b_part()
599 memcpy(bli, s->block_last_index, sizeof(bli)); in h263_skip_b_part()
600 s->mb_intra = 0; in h263_skip_b_part()
602 if (h263_decode_block(s, dblock, i, cbp&32) < 0) in h263_skip_b_part()
603 return -1; in h263_skip_b_part()
606 s->mb_intra = mbi; in h263_skip_b_part()
607 memcpy(s->block_last_index, bli, sizeof(bli)); in h263_skip_b_part()
615 if (pb_frame < 3) { // h.263 Annex G and i263 PB-frame in h263_get_modb()
619 } else { // h.263 Annex M improved PB-frame in h263_get_modb()
629 #define tab_size ((signed)FF_ARRAY_ELEMS(s->direct_scale_mv[0]))
631 static inline void set_one_direct_mv(MpegEncContext *s, Picture *p, int i) in set_one_direct_mv() argument
633 int xy = s->block_index[i]; in set_one_direct_mv()
634 uint16_t time_pp = s->pp_time; in set_one_direct_mv()
635 uint16_t time_pb = s->pb_time; in set_one_direct_mv()
638 p_mx = p->motion_val[0][xy][0]; in set_one_direct_mv()
640 s->mv[0][i][0] = s->direct_scale_mv[0][p_mx + tab_bias]; in set_one_direct_mv()
641 s->mv[1][i][0] = s->direct_scale_mv[1][p_mx + tab_bias]; in set_one_direct_mv()
643 s->mv[0][i][0] = p_mx * time_pb / time_pp; in set_one_direct_mv()
644 s->mv[1][i][0] = p_mx * (time_pb - time_pp) / time_pp; in set_one_direct_mv()
646 p_my = p->motion_val[0][xy][1]; in set_one_direct_mv()
648 s->mv[0][i][1] = s->direct_scale_mv[0][p_my + tab_bias]; in set_one_direct_mv()
649 s->mv[1][i][1] = s->direct_scale_mv[1][p_my + tab_bias]; in set_one_direct_mv()
651 s->mv[0][i][1] = p_my * time_pb / time_pp; in set_one_direct_mv()
652 s->mv[1][i][1] = p_my * (time_pb - time_pp) / time_pp; in set_one_direct_mv()
659 static int set_direct_mv(MpegEncContext *s) in set_direct_mv() argument
661 const int mb_index = s->mb_x + s->mb_y * s->mb_stride; in set_direct_mv()
662 Picture *p = &s->next_picture; in set_direct_mv()
663 int colocated_mb_type = p->mb_type[mb_index]; in set_direct_mv()
666 if (s->codec_tag == AV_RL32("U263") && p->f->pict_type == AV_PICTURE_TYPE_I) { in set_direct_mv()
667 p = &s->last_picture; in set_direct_mv()
668 colocated_mb_type = p->mb_type[mb_index]; in set_direct_mv()
672 s->mv_type = MV_TYPE_8X8; in set_direct_mv()
674 set_one_direct_mv(s, p, i); in set_direct_mv()
677 set_one_direct_mv(s, p, 0); in set_direct_mv()
678 s->mv[0][1][0] = in set_direct_mv()
679 s->mv[0][2][0] = in set_direct_mv()
680 s->mv[0][3][0] = s->mv[0][0][0]; in set_direct_mv()
681 s->mv[0][1][1] = in set_direct_mv()
682 s->mv[0][2][1] = in set_direct_mv()
683 s->mv[0][3][1] = s->mv[0][0][1]; in set_direct_mv()
684 s->mv[1][1][0] = in set_direct_mv()
685 s->mv[1][2][0] = in set_direct_mv()
686 s->mv[1][3][0] = s->mv[1][0][0]; in set_direct_mv()
687 s->mv[1][1][1] = in set_direct_mv()
688 s->mv[1][2][1] = in set_direct_mv()
689 s->mv[1][3][1] = s->mv[1][0][1]; in set_direct_mv()
690 s->mv_type = MV_TYPE_8X8; in set_direct_mv()
696 int ff_h263_decode_mb(MpegEncContext *s, in ff_h263_decode_mb() argument
701 const int xy= s->mb_x + s->mb_y * s->mb_stride; in ff_h263_decode_mb()
704 av_assert2(!s->h263_pred); in ff_h263_decode_mb()
706 if (s->pict_type == AV_PICTURE_TYPE_P) { in ff_h263_decode_mb()
708 if (get_bits1(&s->gb)) { in ff_h263_decode_mb()
710 s->mb_intra = 0; in ff_h263_decode_mb()
712 s->block_last_index[i] = -1; in ff_h263_decode_mb()
713 s->mv_dir = MV_DIR_FORWARD; in ff_h263_decode_mb()
714 s->mv_type = MV_TYPE_16X16; in ff_h263_decode_mb()
715 s->current_picture.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0; in ff_h263_decode_mb()
716 s->mv[0][0][0] = 0; in ff_h263_decode_mb()
717 s->mv[0][0][1] = 0; in ff_h263_decode_mb()
718 s->mb_skipped = !(s->obmc | s->loop_filter); in ff_h263_decode_mb()
721 cbpc = get_vlc2(&s->gb, ff_h263_inter_MCBPC_vlc.table, INTER_MCBPC_VLC_BITS, 2); in ff_h263_decode_mb()
723 av_log(s->avctx, AV_LOG_ERROR, "cbpc damaged at %d %d\n", s->mb_x, s->mb_y); in ff_h263_decode_mb()
728 s->bdsp.clear_blocks(s->block[0]); in ff_h263_decode_mb()
731 s->mb_intra = ((cbpc & 4) != 0); in ff_h263_decode_mb()
732 if (s->mb_intra) goto intra; in ff_h263_decode_mb()
734 if(s->pb_frame && get_bits1(&s->gb)) in ff_h263_decode_mb()
735 pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb); in ff_h263_decode_mb()
736 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); in ff_h263_decode_mb()
739 av_log(s->avctx, AV_LOG_ERROR, "cbpy damaged at %d %d\n", s->mb_x, s->mb_y); in ff_h263_decode_mb()
743 if(s->alt_inter_vlc==0 || (cbpc & 3)!=3) in ff_h263_decode_mb()
748 h263_decode_dquant(s); in ff_h263_decode_mb()
751 s->mv_dir = MV_DIR_FORWARD; in ff_h263_decode_mb()
753 s->current_picture.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; in ff_h263_decode_mb()
755 s->mv_type = MV_TYPE_16X16; in ff_h263_decode_mb()
756 ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); in ff_h263_decode_mb()
757 if (s->umvplus) in ff_h263_decode_mb()
758 mx = h263p_decode_umotion(s, pred_x); in ff_h263_decode_mb()
760 mx = ff_h263_decode_motion(s, pred_x, 1); in ff_h263_decode_mb()
765 if (s->umvplus) in ff_h263_decode_mb()
766 my = h263p_decode_umotion(s, pred_y); in ff_h263_decode_mb()
768 my = ff_h263_decode_motion(s, pred_y, 1); in ff_h263_decode_mb()
772 s->mv[0][0][0] = mx; in ff_h263_decode_mb()
773 s->mv[0][0][1] = my; in ff_h263_decode_mb()
775 if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) in ff_h263_decode_mb()
776 skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ in ff_h263_decode_mb()
778 s->current_picture.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; in ff_h263_decode_mb()
779 s->mv_type = MV_TYPE_8X8; in ff_h263_decode_mb()
781 mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); in ff_h263_decode_mb()
782 if (s->umvplus) in ff_h263_decode_mb()
783 mx = h263p_decode_umotion(s, pred_x); in ff_h263_decode_mb()
785 mx = ff_h263_decode_motion(s, pred_x, 1); in ff_h263_decode_mb()
789 if (s->umvplus) in ff_h263_decode_mb()
790 my = h263p_decode_umotion(s, pred_y); in ff_h263_decode_mb()
792 my = ff_h263_decode_motion(s, pred_y, 1); in ff_h263_decode_mb()
795 s->mv[0][i][0] = mx; in ff_h263_decode_mb()
796 s->mv[0][i][1] = my; in ff_h263_decode_mb()
797 if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) in ff_h263_decode_mb()
798 skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ in ff_h263_decode_mb()
803 } else if(s->pict_type==AV_PICTURE_TYPE_B) { in ff_h263_decode_mb()
805 const int stride= s->b8_stride; in ff_h263_decode_mb()
806 int16_t *mot_val0 = s->current_picture.motion_val[0][2 * (s->mb_x + s->mb_y * stride)]; in ff_h263_decode_mb()
807 int16_t *mot_val1 = s->current_picture.motion_val[1][2 * (s->mb_x + s->mb_y * stride)]; in ff_h263_decode_mb()
808 // const int mv_xy= s->mb_x + 1 + s->mb_y * s->mb_stride; in ff_h263_decode_mb()
817 mb_type= get_vlc2(&s->gb, h263_mbtype_b_vlc.table, H263_MBTYPE_B_VLC_BITS, 2); in ff_h263_decode_mb()
819 av_log(s->avctx, AV_LOG_ERROR, "b mb_type damaged at %d %d\n", s->mb_x, s->mb_y); in ff_h263_decode_mb()
826 s->mb_intra = IS_INTRA(mb_type); in ff_h263_decode_mb()
828 s->bdsp.clear_blocks(s->block[0]); in ff_h263_decode_mb()
829 cbpc = get_vlc2(&s->gb, cbpc_b_vlc.table, CBPC_B_VLC_BITS, 1); in ff_h263_decode_mb()
830 if(s->mb_intra){ in ff_h263_decode_mb()
835 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); in ff_h263_decode_mb()
838 av_log(s->avctx, AV_LOG_ERROR, "b cbpy damaged at %d %d\n", s->mb_x, s->mb_y); in ff_h263_decode_mb()
842 if(s->alt_inter_vlc==0 || (cbpc & 3)!=3) in ff_h263_decode_mb()
849 av_assert2(!s->mb_intra); in ff_h263_decode_mb()
852 h263_decode_dquant(s); in ff_h263_decode_mb()
856 s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT; in ff_h263_decode_mb()
857 mb_type |= set_direct_mv(s); in ff_h263_decode_mb()
859 s->mv_dir = 0; in ff_h263_decode_mb()
860 s->mv_type= MV_TYPE_16X16; in ff_h263_decode_mb()
864 int16_t *mot_val= ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); in ff_h263_decode_mb()
865 s->mv_dir = MV_DIR_FORWARD; in ff_h263_decode_mb()
867 if (s->umvplus) in ff_h263_decode_mb()
868 mx = h263p_decode_umotion(s, pred_x); in ff_h263_decode_mb()
870 mx = ff_h263_decode_motion(s, pred_x, 1); in ff_h263_decode_mb()
874 if (s->umvplus) in ff_h263_decode_mb()
875 my = h263p_decode_umotion(s, pred_y); in ff_h263_decode_mb()
877 my = ff_h263_decode_motion(s, pred_y, 1); in ff_h263_decode_mb()
881 if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) in ff_h263_decode_mb()
882 skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ in ff_h263_decode_mb()
884 s->mv[0][0][0] = mx; in ff_h263_decode_mb()
885 s->mv[0][0][1] = my; in ff_h263_decode_mb()
891 int16_t *mot_val= ff_h263_pred_motion(s, 0, 1, &pred_x, &pred_y); in ff_h263_decode_mb()
892 s->mv_dir |= MV_DIR_BACKWARD; in ff_h263_decode_mb()
894 if (s->umvplus) in ff_h263_decode_mb()
895 mx = h263p_decode_umotion(s, pred_x); in ff_h263_decode_mb()
897 mx = ff_h263_decode_motion(s, pred_x, 1); in ff_h263_decode_mb()
901 if (s->umvplus) in ff_h263_decode_mb()
902 my = h263p_decode_umotion(s, pred_y); in ff_h263_decode_mb()
904 my = ff_h263_decode_motion(s, pred_y, 1); in ff_h263_decode_mb()
908 if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) in ff_h263_decode_mb()
909 skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ in ff_h263_decode_mb()
911 s->mv[1][0][0] = mx; in ff_h263_decode_mb()
912 s->mv[1][0][1] = my; in ff_h263_decode_mb()
918 s->current_picture.mb_type[xy] = mb_type; in ff_h263_decode_mb()
919 } else { /* I-Frame */ in ff_h263_decode_mb()
921 cbpc = get_vlc2(&s->gb, ff_h263_intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2); in ff_h263_decode_mb()
923 av_log(s->avctx, AV_LOG_ERROR, "I cbpc damaged at %d %d\n", s->mb_x, s->mb_y); in ff_h263_decode_mb()
928 s->bdsp.clear_blocks(s->block[0]); in ff_h263_decode_mb()
931 s->mb_intra = 1; in ff_h263_decode_mb()
933 s->current_picture.mb_type[xy] = MB_TYPE_INTRA; in ff_h263_decode_mb()
934 if (s->h263_aic) { in ff_h263_decode_mb()
935 s->ac_pred = get_bits1(&s->gb); in ff_h263_decode_mb()
936 if(s->ac_pred){ in ff_h263_decode_mb()
937 s->current_picture.mb_type[xy] = MB_TYPE_INTRA | MB_TYPE_ACPRED; in ff_h263_decode_mb()
939 s->h263_aic_dir = get_bits1(&s->gb); in ff_h263_decode_mb()
942 s->ac_pred = 0; in ff_h263_decode_mb()
944 if(s->pb_frame && get_bits1(&s->gb)) in ff_h263_decode_mb()
945 pb_mv_count = h263_get_modb(&s->gb, s->pb_frame, &cbpb); in ff_h263_decode_mb()
946 cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); in ff_h263_decode_mb()
948 av_log(s->avctx, AV_LOG_ERROR, "I cbpy damaged at %d %d\n", s->mb_x, s->mb_y); in ff_h263_decode_mb()
953 h263_decode_dquant(s); in ff_h263_decode_mb()
956 pb_mv_count += !!s->pb_frame; in ff_h263_decode_mb()
959 while(pb_mv_count--){ in ff_h263_decode_mb()
960 ff_h263_decode_motion(s, 0, 1); in ff_h263_decode_mb()
961 ff_h263_decode_motion(s, 0, 1); in ff_h263_decode_mb()
966 if (h263_decode_block(s, block[i], i, cbp&32) < 0) in ff_h263_decode_mb()
967 return -1; in ff_h263_decode_mb()
971 if(s->pb_frame && h263_skip_b_part(s, cbpb) < 0) in ff_h263_decode_mb()
972 return -1; in ff_h263_decode_mb()
973 if(s->obmc && !s->mb_intra){ in ff_h263_decode_mb()
974 if(s->pict_type == AV_PICTURE_TYPE_P && s->mb_x+1<s->mb_width && s->mb_num_left != 1) in ff_h263_decode_mb()
975 preview_obmc(s); in ff_h263_decode_mb()
979 if (get_bits_left(&s->gb) < 0) in ff_h263_decode_mb()
982 /* per-MB end of slice check */ in ff_h263_decode_mb()
984 int v= show_bits(&s->gb, 16); in ff_h263_decode_mb()
986 if (get_bits_left(&s->gb) < 16) { in ff_h263_decode_mb()
987 v >>= 16 - get_bits_left(&s->gb); in ff_h263_decode_mb()
998 int ff_h263_decode_picture_header(MpegEncContext *s) in ff_h263_decode_picture_header() argument
1003 align_get_bits(&s->gb); in ff_h263_decode_picture_header()
1005 if (show_bits(&s->gb, 2) == 2 && s->avctx->frame_number == 0) { in ff_h263_decode_picture_header()
1006 av_log(s->avctx, AV_LOG_WARNING, "Header looks like RTP instead of H.263\n"); in ff_h263_decode_picture_header()
1009 startcode= get_bits(&s->gb, 22-8); in ff_h263_decode_picture_header()
1011 for(i= get_bits_left(&s->gb); i>24; i-=8) { in ff_h263_decode_picture_header()
1012 startcode = ((startcode << 8) | get_bits(&s->gb, 8)) & 0x003FFFFF; in ff_h263_decode_picture_header()
1019 av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n"); in ff_h263_decode_picture_header()
1020 return -1; in ff_h263_decode_picture_header()
1023 i = get_bits(&s->gb, 8); /* picture timestamp */ in ff_h263_decode_picture_header()
1025 i -= (i - (s->picture_number & 0xFF) + 128) & ~0xFF; in ff_h263_decode_picture_header()
1027 s->picture_number= (s->picture_number&~0xFF) + i; in ff_h263_decode_picture_header()
1030 if (check_marker(s->avctx, &s->gb, "in PTYPE") != 1) { in ff_h263_decode_picture_header()
1031 return -1; in ff_h263_decode_picture_header()
1033 if (get_bits1(&s->gb) != 0) { in ff_h263_decode_picture_header()
1034 av_log(s->avctx, AV_LOG_ERROR, "Bad H.263 id\n"); in ff_h263_decode_picture_header()
1035 return -1; /* H.263 id */ in ff_h263_decode_picture_header()
1037 skip_bits1(&s->gb); /* split screen off */ in ff_h263_decode_picture_header()
1038 skip_bits1(&s->gb); /* camera off */ in ff_h263_decode_picture_header()
1039 skip_bits1(&s->gb); /* freeze picture release off */ in ff_h263_decode_picture_header()
1041 format = get_bits(&s->gb, 3); in ff_h263_decode_picture_header()
1044 1 sub-QCIF in ff_h263_decode_picture_header()
1050 s->h263_plus = 0; in ff_h263_decode_picture_header()
1055 return -1; in ff_h263_decode_picture_header()
1057 s->pict_type = AV_PICTURE_TYPE_I + get_bits1(&s->gb); in ff_h263_decode_picture_header()
1059 s->h263_long_vectors = get_bits1(&s->gb); in ff_h263_decode_picture_header()
1061 if (get_bits1(&s->gb) != 0) { in ff_h263_decode_picture_header()
1062 av_log(s->avctx, AV_LOG_ERROR, "H.263 SAC not supported\n"); in ff_h263_decode_picture_header()
1063 return -1; /* SAC: off */ in ff_h263_decode_picture_header()
1065 s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */ in ff_h263_decode_picture_header()
1066 s->unrestricted_mv = s->h263_long_vectors || s->obmc; in ff_h263_decode_picture_header()
1068 s->pb_frame = get_bits1(&s->gb); in ff_h263_decode_picture_header()
1069 s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); in ff_h263_decode_picture_header()
1070 skip_bits1(&s->gb); /* Continuous Presence Multipoint mode: off */ in ff_h263_decode_picture_header()
1072 s->width = width; in ff_h263_decode_picture_header()
1073 s->height = height; in ff_h263_decode_picture_header()
1074 s->avctx->sample_aspect_ratio= (AVRational){12,11}; in ff_h263_decode_picture_header()
1075 s->avctx->framerate = (AVRational){ 30000, 1001 }; in ff_h263_decode_picture_header()
1080 s->h263_plus = 1; in ff_h263_decode_picture_header()
1081 ufep = get_bits(&s->gb, 3); /* Update Full Extended PTYPE */ in ff_h263_decode_picture_header()
1086 format = get_bits(&s->gb, 3); in ff_h263_decode_picture_header()
1087 ff_dlog(s->avctx, "ufep=1, format: %d\n", format); in ff_h263_decode_picture_header()
1088 s->custom_pcf= get_bits1(&s->gb); in ff_h263_decode_picture_header()
1089 s->umvplus = get_bits1(&s->gb); /* Unrestricted Motion Vector */ in ff_h263_decode_picture_header()
1090 if (get_bits1(&s->gb) != 0) { in ff_h263_decode_picture_header()
1091 … av_log(s->avctx, AV_LOG_ERROR, "Syntax-based Arithmetic Coding (SAC) not supported\n"); in ff_h263_decode_picture_header()
1093 s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */ in ff_h263_decode_picture_header()
1094 s->h263_aic = get_bits1(&s->gb); /* Advanced Intra Coding (AIC) */ in ff_h263_decode_picture_header()
1095 s->loop_filter= get_bits1(&s->gb); in ff_h263_decode_picture_header()
1096 s->unrestricted_mv = s->umvplus || s->obmc || s->loop_filter; in ff_h263_decode_picture_header()
1097 if(s->avctx->lowres) in ff_h263_decode_picture_header()
1098 s->loop_filter = 0; in ff_h263_decode_picture_header()
1100 s->h263_slice_structured= get_bits1(&s->gb); in ff_h263_decode_picture_header()
1101 if (get_bits1(&s->gb) != 0) { in ff_h263_decode_picture_header()
1102 av_log(s->avctx, AV_LOG_ERROR, "Reference Picture Selection not supported\n"); in ff_h263_decode_picture_header()
1104 if (get_bits1(&s->gb) != 0) { in ff_h263_decode_picture_header()
1105 av_log(s->avctx, AV_LOG_ERROR, "Independent Segment Decoding not supported\n"); in ff_h263_decode_picture_header()
1107 s->alt_inter_vlc= get_bits1(&s->gb); in ff_h263_decode_picture_header()
1108 s->modified_quant= get_bits1(&s->gb); in ff_h263_decode_picture_header()
1109 if(s->modified_quant) in ff_h263_decode_picture_header()
1110 s->chroma_qscale_table= ff_h263_chroma_qscale_table; in ff_h263_decode_picture_header()
1112 skip_bits(&s->gb, 1); /* Prevent start code emulation */ in ff_h263_decode_picture_header()
1114 skip_bits(&s->gb, 3); /* Reserved */ in ff_h263_decode_picture_header()
1116 av_log(s->avctx, AV_LOG_ERROR, "Bad UFEP type (%d)\n", ufep); in ff_h263_decode_picture_header()
1117 return -1; in ff_h263_decode_picture_header()
1121 s->pict_type = get_bits(&s->gb, 3); in ff_h263_decode_picture_header()
1122 switch(s->pict_type){ in ff_h263_decode_picture_header()
1123 case 0: s->pict_type= AV_PICTURE_TYPE_I;break; in ff_h263_decode_picture_header()
1124 case 1: s->pict_type= AV_PICTURE_TYPE_P;break; in ff_h263_decode_picture_header()
1125 case 2: s->pict_type= AV_PICTURE_TYPE_P;s->pb_frame = 3;break; in ff_h263_decode_picture_header()
1126 case 3: s->pict_type= AV_PICTURE_TYPE_B;break; in ff_h263_decode_picture_header()
1127 case 7: s->pict_type= AV_PICTURE_TYPE_I;break; //ZYGO in ff_h263_decode_picture_header()
1129 return -1; in ff_h263_decode_picture_header()
1131 skip_bits(&s->gb, 2); in ff_h263_decode_picture_header()
1132 s->no_rounding = get_bits1(&s->gb); in ff_h263_decode_picture_header()
1133 skip_bits(&s->gb, 4); in ff_h263_decode_picture_header()
1139 s->aspect_ratio_info = get_bits(&s->gb, 4); in ff_h263_decode_picture_header()
1140 ff_dlog(s->avctx, "aspect: %d\n", s->aspect_ratio_info); in ff_h263_decode_picture_header()
1142 0 - forbidden in ff_h263_decode_picture_header()
1143 1 - 1:1 in ff_h263_decode_picture_header()
1144 2 - 12:11 (CIF 4:3) in ff_h263_decode_picture_header()
1145 3 - 10:11 (525-type 4:3) in ff_h263_decode_picture_header()
1146 4 - 16:11 (CIF 16:9) in ff_h263_decode_picture_header()
1147 5 - 40:33 (525-type 16:9) in ff_h263_decode_picture_header()
1148 6-14 - reserved in ff_h263_decode_picture_header()
1150 width = (get_bits(&s->gb, 9) + 1) * 4; in ff_h263_decode_picture_header()
1151 check_marker(s->avctx, &s->gb, "in dimensions"); in ff_h263_decode_picture_header()
1152 height = get_bits(&s->gb, 9) * 4; in ff_h263_decode_picture_header()
1153 ff_dlog(s->avctx, "\nH.263+ Custom picture: %dx%d\n",width,height); in ff_h263_decode_picture_header()
1154 if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) { in ff_h263_decode_picture_header()
1156 s->avctx->sample_aspect_ratio.num= get_bits(&s->gb, 8); in ff_h263_decode_picture_header()
1157 s->avctx->sample_aspect_ratio.den= get_bits(&s->gb, 8); in ff_h263_decode_picture_header()
1159 s->avctx->sample_aspect_ratio= ff_h263_pixel_aspect[s->aspect_ratio_info]; in ff_h263_decode_picture_header()
1164 s->avctx->sample_aspect_ratio= (AVRational){12,11}; in ff_h263_decode_picture_header()
1166 s->avctx->sample_aspect_ratio.den <<= s->ehc_mode; in ff_h263_decode_picture_header()
1168 return -1; in ff_h263_decode_picture_header()
1169 s->width = width; in ff_h263_decode_picture_header()
1170 s->height = height; in ff_h263_decode_picture_header()
1172 if(s->custom_pcf){ in ff_h263_decode_picture_header()
1174 s->avctx->framerate.num = 1800000; in ff_h263_decode_picture_header()
1175 s->avctx->framerate.den = 1000 + get_bits1(&s->gb); in ff_h263_decode_picture_header()
1176 s->avctx->framerate.den *= get_bits(&s->gb, 7); in ff_h263_decode_picture_header()
1177 if(s->avctx->framerate.den == 0){ in ff_h263_decode_picture_header()
1178 av_log(s, AV_LOG_ERROR, "zero framerate\n"); in ff_h263_decode_picture_header()
1179 return -1; in ff_h263_decode_picture_header()
1181 gcd= av_gcd(s->avctx->framerate.den, s->avctx->framerate.num); in ff_h263_decode_picture_header()
1182 s->avctx->framerate.den /= gcd; in ff_h263_decode_picture_header()
1183 s->avctx->framerate.num /= gcd; in ff_h263_decode_picture_header()
1185 s->avctx->framerate = (AVRational){ 30000, 1001 }; in ff_h263_decode_picture_header()
1189 if(s->custom_pcf){ in ff_h263_decode_picture_header()
1190 skip_bits(&s->gb, 2); //extended Temporal reference in ff_h263_decode_picture_header()
1194 if (s->umvplus) { in ff_h263_decode_picture_header()
1195 if(get_bits1(&s->gb)==0) /* Unlimited Unrestricted Motion Vectors Indicator (UUI) */ in ff_h263_decode_picture_header()
1196 skip_bits1(&s->gb); in ff_h263_decode_picture_header()
1198 if(s->h263_slice_structured){ in ff_h263_decode_picture_header()
1199 if (get_bits1(&s->gb) != 0) { in ff_h263_decode_picture_header()
1200 av_log(s->avctx, AV_LOG_ERROR, "rectangular slices not supported\n"); in ff_h263_decode_picture_header()
1202 if (get_bits1(&s->gb) != 0) { in ff_h263_decode_picture_header()
1203 av_log(s->avctx, AV_LOG_ERROR, "unordered slices not supported\n"); in ff_h263_decode_picture_header()
1206 if (s->pict_type == AV_PICTURE_TYPE_B) { in ff_h263_decode_picture_header()
1207 skip_bits(&s->gb, 4); //ELNUM in ff_h263_decode_picture_header()
1209 skip_bits(&s->gb, 4); // RLNUM in ff_h263_decode_picture_header()
1214 s->qscale = get_bits(&s->gb, 5); in ff_h263_decode_picture_header()
1217 if ((ret = av_image_check_size(s->width, s->height, 0, s)) < 0) in ff_h263_decode_picture_header()
1220 if (!(s->avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) { in ff_h263_decode_picture_header()
1221 if ((s->width * s->height / 256 / 8) > get_bits_left(&s->gb)) in ff_h263_decode_picture_header()
1225 s->mb_width = (s->width + 15) / 16; in ff_h263_decode_picture_header()
1226 s->mb_height = (s->height + 15) / 16; in ff_h263_decode_picture_header()
1227 s->mb_num = s->mb_width * s->mb_height; in ff_h263_decode_picture_header()
1229 if (s->pb_frame) { in ff_h263_decode_picture_header()
1230 skip_bits(&s->gb, 3); /* Temporal reference for B-pictures */ in ff_h263_decode_picture_header()
1231 if (s->custom_pcf) in ff_h263_decode_picture_header()
1232 skip_bits(&s->gb, 2); //extended Temporal reference in ff_h263_decode_picture_header()
1233 skip_bits(&s->gb, 2); /* Quantization information for B-pictures */ in ff_h263_decode_picture_header()
1236 if (s->pict_type!=AV_PICTURE_TYPE_B) { in ff_h263_decode_picture_header()
1237 s->time = s->picture_number; in ff_h263_decode_picture_header()
1238 s->pp_time = s->time - s->last_non_b_time; in ff_h263_decode_picture_header()
1239 s->last_non_b_time = s->time; in ff_h263_decode_picture_header()
1241 s->time = s->picture_number; in ff_h263_decode_picture_header()
1242 s->pb_time = s->pp_time - (s->last_non_b_time - s->time); in ff_h263_decode_picture_header()
1243 if (s->pp_time <=s->pb_time || in ff_h263_decode_picture_header()
1244 s->pp_time <= s->pp_time - s->pb_time || in ff_h263_decode_picture_header()
1245 s->pp_time <= 0){ in ff_h263_decode_picture_header()
1246 s->pp_time = 2; in ff_h263_decode_picture_header()
1247 s->pb_time = 1; in ff_h263_decode_picture_header()
1249 ff_mpeg4_init_direct_mv(s); in ff_h263_decode_picture_header()
1253 if (skip_1stop_8data_bits(&s->gb) < 0) in ff_h263_decode_picture_header()
1256 if(s->h263_slice_structured){ in ff_h263_decode_picture_header()
1257 if (check_marker(s->avctx, &s->gb, "SEPB1") != 1) { in ff_h263_decode_picture_header()
1258 return -1; in ff_h263_decode_picture_header()
1261 ff_h263_decode_mba(s); in ff_h263_decode_picture_header()
1263 if (check_marker(s->avctx, &s->gb, "SEPB2") != 1) { in ff_h263_decode_picture_header()
1264 return -1; in ff_h263_decode_picture_header()
1267 s->f_code = 1; in ff_h263_decode_picture_header()
1269 if (s->pict_type == AV_PICTURE_TYPE_B) in ff_h263_decode_picture_header()
1270 s->low_delay = 0; in ff_h263_decode_picture_header()
1272 if(s->h263_aic){ in ff_h263_decode_picture_header()
1273 s->y_dc_scale_table= in ff_h263_decode_picture_header()
1274 s->c_dc_scale_table= ff_aic_dc_scale_table; in ff_h263_decode_picture_header()
1276 s->y_dc_scale_table= in ff_h263_decode_picture_header()
1277 s->c_dc_scale_table= ff_mpeg1_dc_scale_table; in ff_h263_decode_picture_header()
1280 ff_h263_show_pict_info(s); in ff_h263_decode_picture_header()
1281 …if (s->pict_type == AV_PICTURE_TYPE_I && s->codec_tag == AV_RL32("ZYGO") && get_bits_left(&s->gb) … in ff_h263_decode_picture_header()
1283 for(i=0; i<85; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb)); in ff_h263_decode_picture_header()
1284 av_log(s->avctx, AV_LOG_DEBUG, "\n"); in ff_h263_decode_picture_header()
1287 int v= get_bits(&s->gb, 8); in ff_h263_decode_picture_header()
1288 v |= get_sbits(&s->gb, 8) * (1 << 8); in ff_h263_decode_picture_header()
1289 av_log(s->avctx, AV_LOG_DEBUG, " %5d", v); in ff_h263_decode_picture_header()
1291 av_log(s->avctx, AV_LOG_DEBUG, "\n"); in ff_h263_decode_picture_header()
1293 for(i=0; i<50; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb)); in ff_h263_decode_picture_header()