30 #define UNCHECKED_BITSTREAM_READER 1
50 #define H263_MBTYPE_B_VLC_BITS 6
51 #define CBPC_B_VLC_BITS 3
105 static volatile int done = 0;
154 unsigned int val, gob_number;
166 for(;left>13; left--){
229 for(;left>16+1+5+5; left-=8){
263 val = (val - 1) << shift;
276 if (pred < -31 && val < -63)
278 if (pred > 32 && val > 63)
304 code = (sign) ? (pred - code) : (pred + code);
316 int cbpc, i, pred_x, pred_y, mx, my;
333 mot_val[0 ]= mot_val[2 ]=
334 mot_val[0+stride]= mot_val[2+stride]= 0;
335 mot_val[1 ]= mot_val[3 ]=
336 mot_val[1+stride]= mot_val[3+stride]= 0;
356 if ((cbpc & 16) == 0) {
370 mot_val[0 ]= mot_val[2 ]=
371 mot_val[0+stride]= mot_val[2+stride]= mx;
372 mot_val[1 ]= mot_val[3 ]=
373 mot_val[1+stride]= mot_val[3+stride]= my;
387 if (s->
umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
406 static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
439 #if CONFIG_RV10_DECODER
442 component = (n <= 3 ? 0 : n - 4 + 1);
449 level = level & 0xff;
462 if((level&0x7F) == 0){
495 if (CONFIG_FLV_DECODER && s->
h263_flv > 1) {
537 i = i - run + ((run-1)&63) + 1;
540 block[scan_table[i]] =
level;
579 for (i = 0; i < 6; i++) {
595 if (pb_frame == 2 && c)
608 int16_t
block[6][64])
610 int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
613 int cbpb = 0, pb_mv_count = 0;
652 cbp = (cbpc & 3) | (cbpy << 2);
658 if ((cbpc & 16) == 0) {
681 if (s->
umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
703 if (s->
umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
717 mot_val0[0 ]= mot_val0[2 ]= mot_val0[0+2*stride]= mot_val0[2+2*stride]=
718 mot_val0[1 ]= mot_val0[3 ]= mot_val0[1+2*stride]= mot_val0[3+2*stride]=
719 mot_val1[0 ]= mot_val1[2 ]= mot_val1[0+2*stride]= mot_val1[2+2*stride]=
720 mot_val1[1 ]= mot_val1[3 ]= mot_val1[1+2*stride]= mot_val1[3+2*stride]= 0;
751 cbp = (cbpc & 3) | (cbpy << 2);
778 mot_val[0 ]= mot_val[2 ]= mot_val[0+2*stride]= mot_val[2+2*stride]= mx;
779 mot_val[1 ]= mot_val[3 ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my;
791 mot_val[0 ]= mot_val[2 ]= mot_val[0+2*stride]= mot_val[2+2*stride]= mx;
792 mot_val[1 ]= mot_val[3 ]= mot_val[1+2*stride]= mot_val[3+2*stride]= my;
829 cbp = (cbpc & 3) | (cbpy << 2);
837 while(pb_mv_count--){
843 for (i = 0; i < 6; i++) {
887 startcode = ((startcode << 8) |
get_bits(&s->
gb, 8)) & 0x003FFFFF;
889 if(startcode == 0x20)
893 if (startcode != 0x20) {
925 if (format != 7 && format != 6) {
991 }
else if (ufep != 0) {
1029 av_dlog(s->
avctx,
"\nH.263+ Custom picture: %dx%d\n",width,height);
1043 if ((width == 0) || (height == 0))
1150 for(i=0; i<13; i++){