You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

714 lines
21KB

  1. /*
  2. * H263 decoder
  3. * Copyright (c) 2001 Fabrice Bellard.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #include "avcodec.h"
  20. #include "dsputil.h"
  21. #include "mpegvideo.h"
  22. #if 1
  23. #define PRINT_QP(a, b) {}
  24. #else
  25. #define PRINT_QP(a, b) printf(a, b)
  26. #endif
  27. //#define DEBUG
  28. //#define PRINT_FRAME_TIME
  29. #ifdef PRINT_FRAME_TIME
  30. static inline long long rdtsc()
  31. {
  32. long long l;
  33. asm volatile( "rdtsc\n\t"
  34. : "=A" (l)
  35. );
  36. // printf("%d\n", int(l/1000));
  37. return l;
  38. }
  39. #endif
  40. static int h263_decode_init(AVCodecContext *avctx)
  41. {
  42. MpegEncContext *s = avctx->priv_data;
  43. s->avctx = avctx;
  44. s->out_format = FMT_H263;
  45. s->width = avctx->width;
  46. s->height = avctx->height;
  47. s->workaround_bugs= avctx->workaround_bugs;
  48. // set defaults
  49. s->quant_precision=5;
  50. s->progressive_sequence=1;
  51. s->decode_mb= ff_h263_decode_mb;
  52. /* select sub codec */
  53. switch(avctx->codec->id) {
  54. case CODEC_ID_H263:
  55. s->gob_number = 0;
  56. s->first_slice_line = 0;
  57. break;
  58. case CODEC_ID_MPEG4:
  59. s->time_increment_bits = 4; /* default value for broken headers */
  60. s->h263_pred = 1;
  61. s->has_b_frames = 1; //default, might be overriden in the vol header during header parsing
  62. break;
  63. case CODEC_ID_MSMPEG4V1:
  64. s->h263_msmpeg4 = 1;
  65. s->h263_pred = 1;
  66. s->msmpeg4_version=1;
  67. break;
  68. case CODEC_ID_MSMPEG4V2:
  69. s->h263_msmpeg4 = 1;
  70. s->h263_pred = 1;
  71. s->msmpeg4_version=2;
  72. break;
  73. case CODEC_ID_MSMPEG4V3:
  74. s->h263_msmpeg4 = 1;
  75. s->h263_pred = 1;
  76. s->msmpeg4_version=3;
  77. break;
  78. case CODEC_ID_WMV1:
  79. s->h263_msmpeg4 = 1;
  80. s->h263_pred = 1;
  81. s->msmpeg4_version=4;
  82. break;
  83. case CODEC_ID_WMV2:
  84. s->h263_msmpeg4 = 1;
  85. s->h263_pred = 1;
  86. s->msmpeg4_version=5;
  87. break;
  88. case CODEC_ID_H263I:
  89. s->h263_intel = 1;
  90. break;
  91. default:
  92. return -1;
  93. }
  94. s->codec_id= avctx->codec->id;
  95. /* for h263, we allocate the images after having read the header */
  96. if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4)
  97. if (MPV_common_init(s) < 0)
  98. return -1;
  99. if (s->h263_msmpeg4)
  100. ff_msmpeg4_decode_init(s);
  101. else
  102. h263_decode_init_vlc(s);
  103. return 0;
  104. }
  105. static int h263_decode_end(AVCodecContext *avctx)
  106. {
  107. MpegEncContext *s = avctx->priv_data;
  108. MPV_common_end(s);
  109. return 0;
  110. }
  111. /**
  112. * retunrs the number of bytes consumed for building the current frame
  113. */
  114. static int get_consumed_bytes(MpegEncContext *s, int buf_size){
  115. int pos= (get_bits_count(&s->gb)+7)>>3;
  116. if(s->divx_version>=500){
  117. //we would have to scan through the whole buf to handle the weird reordering ...
  118. return buf_size;
  119. }else{
  120. if(pos==0) pos=1; //avoid infinite loops (i doubt thats needed but ...)
  121. if(pos+10>buf_size) pos=buf_size; // oops ;)
  122. return pos;
  123. }
  124. }
  125. static int decode_slice(MpegEncContext *s){
  126. s->last_resync_gb= s->gb;
  127. s->first_slice_line= 1;
  128. s->resync_mb_x= s->mb_x;
  129. s->resync_mb_y= s->mb_y;
  130. s->y_dc_scale= s->y_dc_scale_table[ s->qscale ];
  131. s->c_dc_scale= s->c_dc_scale_table[ s->qscale ];
  132. if(s->partitioned_frame){
  133. const int qscale= s->qscale;
  134. if(s->codec_id==CODEC_ID_MPEG4){
  135. if(ff_mpeg4_decode_partitions(s) < 0)
  136. return -1;
  137. }
  138. /* restore variables which where modified */
  139. s->first_slice_line=1;
  140. s->mb_x= s->resync_mb_x;
  141. s->mb_y= s->resync_mb_y;
  142. s->qscale= qscale;
  143. s->y_dc_scale= s->y_dc_scale_table[ s->qscale ];
  144. s->c_dc_scale= s->c_dc_scale_table[ s->qscale ];
  145. }
  146. for(; s->mb_y < s->mb_height; s->mb_y++) {
  147. /* per-row end of slice checks */
  148. if(s->msmpeg4_version){
  149. if(s->resync_mb_y + s->slice_height == s->mb_y){
  150. const int xy= s->mb_x + s->mb_y*s->mb_width;
  151. s->error_status_table[xy-1]|= AC_END|DC_END|MV_END;
  152. return 0;
  153. }
  154. }
  155. if(s->msmpeg4_version==1){
  156. s->last_dc[0]=
  157. s->last_dc[1]=
  158. s->last_dc[2]= 128;
  159. }
  160. ff_init_block_index(s);
  161. for(; s->mb_x < s->mb_width; s->mb_x++) {
  162. int ret;
  163. ff_update_block_index(s);
  164. if(s->resync_mb_x == s->mb_x && s->resync_mb_y+1 == s->mb_y){
  165. s->first_slice_line=0;
  166. }
  167. /* DCT & quantize */
  168. clear_blocks(s->block[0]);
  169. s->mv_dir = MV_DIR_FORWARD;
  170. s->mv_type = MV_TYPE_16X16;
  171. //printf("%d %d %06X\n", ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
  172. ret= s->decode_mb(s, s->block);
  173. PRINT_QP("%2d", s->qscale);
  174. MPV_decode_mb(s, s->block);
  175. if(ret<0){
  176. const int xy= s->mb_x + s->mb_y*s->mb_width;
  177. if(ret==SLICE_END){
  178. //printf("%d %d %d %06X\n", s->mb_x, s->mb_y, s->gb.size*8 - get_bits_count(&s->gb), show_bits(&s->gb, 24));
  179. s->error_status_table[xy]|= AC_END;
  180. if(!s->partitioned_frame)
  181. s->error_status_table[xy]|= MV_END|DC_END;
  182. s->padding_bug_score--;
  183. if(++s->mb_x >= s->mb_width){
  184. s->mb_x=0;
  185. ff_draw_horiz_band(s);
  186. s->mb_y++;
  187. }
  188. return 0;
  189. }else if(ret==SLICE_NOEND){
  190. fprintf(stderr,"Slice mismatch at MB: %d\n", xy);
  191. return -1;
  192. }
  193. fprintf(stderr,"Error at MB: %d\n", xy);
  194. s->error_status_table[xy]|= AC_ERROR;
  195. if(!s->partitioned_frame)
  196. s->error_status_table[xy]|= DC_ERROR|MV_ERROR;
  197. return -1;
  198. }
  199. }
  200. ff_draw_horiz_band(s);
  201. PRINT_QP("%s", "\n");
  202. s->mb_x= 0;
  203. }
  204. assert(s->mb_x==0 && s->mb_y==s->mb_height);
  205. /* try to detect the padding bug */
  206. if( s->codec_id==CODEC_ID_MPEG4
  207. && (s->workaround_bugs&FF_BUG_AUTODETECT)
  208. && s->gb.size*8 - get_bits_count(&s->gb) >=0
  209. && s->gb.size*8 - get_bits_count(&s->gb) < 48
  210. && !s->resync_marker
  211. && !s->data_partitioning){
  212. const int bits_count= get_bits_count(&s->gb);
  213. const int bits_left = s->gb.size*8 - bits_count;
  214. if(bits_left==0 || bits_left>8){
  215. s->padding_bug_score++;
  216. } else {
  217. int v= show_bits(&s->gb, 8);
  218. v|= 0x7F >> (7-(bits_count&7));
  219. if(v==0x7F)
  220. s->padding_bug_score--;
  221. else
  222. s->padding_bug_score++;
  223. }
  224. if(s->padding_bug_score > -2)
  225. s->workaround_bugs |= FF_BUG_NO_PADDING;
  226. else
  227. s->workaround_bugs &= ~FF_BUG_NO_PADDING;
  228. }
  229. // handle formats which dont have unique end markers
  230. if(s->msmpeg4_version || (s->workaround_bugs&FF_BUG_NO_PADDING)){ //FIXME perhaps solve this more cleanly
  231. int left= s->gb.size*8 - get_bits_count(&s->gb);
  232. int max_extra=7;
  233. /* no markers in M$ crap */
  234. if(s->msmpeg4_version && s->pict_type==I_TYPE)
  235. max_extra+= 17;
  236. /* buggy padding but the frame should still end approximately at the bitstream end */
  237. if((s->workaround_bugs&FF_BUG_NO_PADDING) && s->error_resilience>=3)
  238. max_extra+= 48;
  239. else if((s->workaround_bugs&FF_BUG_NO_PADDING))
  240. max_extra+= 256*256*256*64;
  241. if(left>max_extra){
  242. fprintf(stderr, "discarding %d junk bits at end, next would be %X\n", left, show_bits(&s->gb, 24));
  243. }
  244. else if(left<0){
  245. fprintf(stderr, "overreading %d bits\n", -left);
  246. }else
  247. s->error_status_table[s->mb_num-1]|= AC_END|MV_END|DC_END;
  248. return 0;
  249. }
  250. fprintf(stderr, "slice end not reached but screenspace end (%d left %06X)\n",
  251. s->gb.size*8 - get_bits_count(&s->gb),
  252. show_bits(&s->gb, 24));
  253. return -1;
  254. }
  255. static int h263_decode_frame(AVCodecContext *avctx,
  256. void *data, int *data_size,
  257. UINT8 *buf, int buf_size)
  258. {
  259. MpegEncContext *s = avctx->priv_data;
  260. int ret,i;
  261. AVPicture *pict = data;
  262. #ifdef PRINT_FRAME_TIME
  263. uint64_t time= rdtsc();
  264. #endif
  265. #ifdef DEBUG
  266. printf("*****frame %d size=%d\n", avctx->frame_number, buf_size);
  267. printf("bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
  268. #endif
  269. s->hurry_up= avctx->hurry_up;
  270. s->error_resilience= avctx->error_resilience;
  271. s->flags= avctx->flags;
  272. *data_size = 0;
  273. /* no supplementary picture */
  274. if (buf_size == 0) {
  275. return 0;
  276. }
  277. retry:
  278. if(s->bitstream_buffer_size && buf_size<20){ //divx 5.01+ frame reorder
  279. init_get_bits(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size);
  280. }else
  281. init_get_bits(&s->gb, buf, buf_size);
  282. s->bitstream_buffer_size=0;
  283. if (!s->context_initialized) {
  284. if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
  285. return -1;
  286. }
  287. /* let's go :-) */
  288. if (s->h263_msmpeg4) {
  289. ret = msmpeg4_decode_picture_header(s);
  290. } else if (s->h263_pred) {
  291. if(s->avctx->extradata_size && s->picture_number==0){
  292. GetBitContext gb;
  293. init_get_bits(&gb, s->avctx->extradata, s->avctx->extradata_size);
  294. ret = ff_mpeg4_decode_picture_header(s, &gb);
  295. }
  296. ret = ff_mpeg4_decode_picture_header(s, &s->gb);
  297. s->has_b_frames= !s->low_delay;
  298. } else if (s->h263_intel) {
  299. ret = intel_h263_decode_picture_header(s);
  300. } else {
  301. ret = h263_decode_picture_header(s);
  302. }
  303. avctx->has_b_frames= s->has_b_frames;
  304. if(s->workaround_bugs&FF_BUG_AUTODETECT){
  305. if(s->avctx->fourcc == ff_get_fourcc("XVIX"))
  306. s->workaround_bugs|= FF_BUG_XVID_ILACE;
  307. if(s->avctx->fourcc == ff_get_fourcc("MP4S"))
  308. s->workaround_bugs|= FF_BUG_AC_VLC;
  309. if(s->avctx->fourcc == ff_get_fourcc("M4S2"))
  310. s->workaround_bugs|= FF_BUG_AC_VLC;
  311. if(s->avctx->fourcc == ff_get_fourcc("UMP4")){
  312. s->workaround_bugs|= FF_BUG_UMP4;
  313. s->workaround_bugs|= FF_BUG_AC_VLC;
  314. }
  315. if(s->divx_version){
  316. s->workaround_bugs|= FF_BUG_QPEL_CHROMA;
  317. }
  318. if(s->avctx->fourcc == ff_get_fourcc("XVID") && s->xvid_build==0)
  319. s->workaround_bugs|= FF_BUG_QPEL_CHROMA;
  320. if(s->xvid_build && s->xvid_build<=1)
  321. s->workaround_bugs|= FF_BUG_QPEL_CHROMA;
  322. //printf("padding_bug_score: %d\n", s->padding_bug_score);
  323. #if 0
  324. if(s->divx_version==500)
  325. s->workaround_bugs|= FF_BUG_NO_PADDING;
  326. /* very ugly XVID padding bug detection FIXME/XXX solve this differently
  327. * lets hope this at least works
  328. */
  329. if( s->resync_marker==0 && s->data_partitioning==0 && s->divx_version==0
  330. && s->codec_id==CODEC_ID_MPEG4 && s->vo_type==0)
  331. s->workaround_bugs|= FF_BUG_NO_PADDING;
  332. if(s->lavc_build && s->lavc_build<4609) //FIXME not sure about the version num but a 4609 file seems ok
  333. s->workaround_bugs|= FF_BUG_NO_PADDING;
  334. #endif
  335. }
  336. #if 0 // dump bits per frame / qp / complexity
  337. {
  338. static FILE *f=NULL;
  339. if(!f) f=fopen("rate_qp_cplx.txt", "w");
  340. fprintf(f, "%d %d %f\n", buf_size, s->qscale, buf_size*(double)s->qscale);
  341. }
  342. #endif
  343. /* After H263 & mpeg4 header decode we have the height, width,*/
  344. /* and other parameters. So then we could init the picture */
  345. /* FIXME: By the way H263 decoder is evolving it should have */
  346. /* an H263EncContext */
  347. if ( s->width != avctx->width || s->height != avctx->height
  348. || avctx->aspect_ratio_info != s->aspect_ratio_info
  349. || avctx->aspected_width != s->aspected_width
  350. || avctx->aspected_height != s->aspected_height) {
  351. /* H.263 could change picture size any time */
  352. MPV_common_end(s);
  353. s->context_initialized=0;
  354. }
  355. if (!s->context_initialized) {
  356. avctx->width = s->width;
  357. avctx->height = s->height;
  358. avctx->aspect_ratio_info= s->aspect_ratio_info;
  359. if (s->aspect_ratio_info == FF_ASPECT_EXTENDED)
  360. {
  361. avctx->aspected_width = s->aspected_width;
  362. avctx->aspected_height = s->aspected_height;
  363. }
  364. goto retry;
  365. }
  366. if((s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P))
  367. s->gob_index = ff_h263_get_gob_height(s);
  368. if(ret==FRAME_SKIPED) return get_consumed_bytes(s, buf_size);
  369. /* skip if the header was thrashed */
  370. if (ret < 0){
  371. fprintf(stderr, "header damaged\n");
  372. return -1;
  373. }
  374. /* skip b frames if we dont have reference frames */
  375. if(s->num_available_buffers<2 && s->pict_type==B_TYPE) return get_consumed_bytes(s, buf_size);
  376. /* skip b frames if we are in a hurry */
  377. if(s->hurry_up && s->pict_type==B_TYPE) return get_consumed_bytes(s, buf_size);
  378. if(s->next_p_frame_damaged){
  379. if(s->pict_type==B_TYPE)
  380. return get_consumed_bytes(s, buf_size);
  381. else
  382. s->next_p_frame_damaged=0;
  383. }
  384. MPV_frame_start(s, avctx);
  385. #ifdef DEBUG
  386. printf("qscale=%d\n", s->qscale);
  387. #endif
  388. if(s->error_resilience)
  389. memset(s->error_status_table, MV_ERROR|AC_ERROR|DC_ERROR|VP_START|AC_END|DC_END|MV_END, s->mb_num*sizeof(UINT8));
  390. /* decode each macroblock */
  391. s->block_wrap[0]=
  392. s->block_wrap[1]=
  393. s->block_wrap[2]=
  394. s->block_wrap[3]= s->mb_width*2 + 2;
  395. s->block_wrap[4]=
  396. s->block_wrap[5]= s->mb_width + 2;
  397. s->mb_x=0;
  398. s->mb_y=0;
  399. decode_slice(s);
  400. s->error_status_table[0]|= VP_START;
  401. while(s->mb_y<s->mb_height && s->gb.size*8 - get_bits_count(&s->gb)>32){
  402. if(s->msmpeg4_version){
  403. if(s->mb_x!=0 || (s->mb_y%s->slice_height)!=0)
  404. break;
  405. }else{
  406. if(ff_h263_resync(s)<0)
  407. break;
  408. }
  409. if(s->msmpeg4_version!=4 && s->h263_pred)
  410. ff_mpeg4_clean_buffers(s);
  411. decode_slice(s);
  412. s->error_status_table[s->resync_mb_x + s->resync_mb_y*s->mb_width]|= VP_START;
  413. }
  414. if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==I_TYPE)
  415. if(msmpeg4_decode_ext_header(s, buf_size) < 0) return -1;
  416. /* divx 5.01+ bistream reorder stuff */
  417. if(s->codec_id==CODEC_ID_MPEG4 && s->bitstream_buffer_size==0 && s->divx_version>=500){
  418. int current_pos= get_bits_count(&s->gb)>>3;
  419. if( buf_size - current_pos > 5
  420. && buf_size - current_pos < BITSTREAM_BUFFER_SIZE){
  421. int i;
  422. int startcode_found=0;
  423. for(i=current_pos; i<buf_size-3; i++){
  424. if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==0xB6){
  425. startcode_found=1;
  426. break;
  427. }
  428. }
  429. if(startcode_found){
  430. memcpy(s->bitstream_buffer, buf + current_pos, buf_size - current_pos);
  431. s->bitstream_buffer_size= buf_size - current_pos;
  432. }
  433. }
  434. }
  435. if(s->error_resilience){
  436. int error=0, num_end_markers=0;
  437. for(i=0; i<s->mb_num; i++){
  438. int status= s->error_status_table[i];
  439. #if 0
  440. if(i%s->mb_width == 0) printf("\n");
  441. printf("%2X ", status);
  442. #endif
  443. if(status==0) continue;
  444. if(status&(DC_ERROR|AC_ERROR|MV_ERROR))
  445. error=1;
  446. if(status&VP_START){
  447. if(num_end_markers)
  448. error=1;
  449. num_end_markers=3;
  450. }
  451. if(status&AC_END)
  452. num_end_markers--;
  453. if(status&DC_END)
  454. num_end_markers--;
  455. if(status&MV_END)
  456. num_end_markers--;
  457. }
  458. if(num_end_markers || error){
  459. fprintf(stderr, "concealing errors\n");
  460. //printf("type:%d\n", s->pict_type);
  461. ff_error_resilience(s);
  462. }
  463. }
  464. MPV_frame_end(s);
  465. #if 0 //dirty show MVs, we should export the MV tables and write a filter to show them
  466. {
  467. int mb_y;
  468. s->has_b_frames=1;
  469. for(mb_y=0; mb_y<s->mb_height; mb_y++){
  470. int mb_x;
  471. int y= mb_y*16 + 8;
  472. for(mb_x=0; mb_x<s->mb_width; mb_x++){
  473. int x= mb_x*16 + 8;
  474. uint8_t *ptr= s->last_picture[0];
  475. int xy= 1 + mb_x*2 + (mb_y*2 + 1)*(s->mb_width*2 + 2);
  476. int mx= (s->motion_val[xy][0]>>1) + x;
  477. int my= (s->motion_val[xy][1]>>1) + y;
  478. int i;
  479. int max;
  480. if(mx<0) mx=0;
  481. if(my<0) my=0;
  482. if(mx>=s->width) mx= s->width -1;
  483. if(my>=s->height) my= s->height-1;
  484. max= ABS(mx-x);
  485. if(ABS(my-y) > max) max= ABS(my-y);
  486. /* the ugliest linedrawing routine ... */
  487. for(i=0; i<max; i++){
  488. int x1= x + (mx-x)*i/max;
  489. int y1= y + (my-y)*i/max;
  490. ptr[y1*s->linesize + x1]+=100;
  491. }
  492. ptr[y*s->linesize + x]+=100;
  493. s->mbskip_table[mb_x + mb_y*s->mb_width]=0;
  494. }
  495. }
  496. }
  497. #endif
  498. if(s->pict_type==B_TYPE || (!s->has_b_frames)){
  499. pict->data[0] = s->current_picture[0];
  500. pict->data[1] = s->current_picture[1];
  501. pict->data[2] = s->current_picture[2];
  502. } else {
  503. pict->data[0] = s->last_picture[0];
  504. pict->data[1] = s->last_picture[1];
  505. pict->data[2] = s->last_picture[2];
  506. }
  507. pict->linesize[0] = s->linesize;
  508. pict->linesize[1] = s->uvlinesize;
  509. pict->linesize[2] = s->uvlinesize;
  510. avctx->quality = s->qscale;
  511. /* Return the Picture timestamp as the frame number */
  512. /* we substract 1 because it is added on utils.c */
  513. avctx->frame_number = s->picture_number - 1;
  514. /* dont output the last pic after seeking
  515. note we allready added +1 for the current pix in MPV_frame_end(s) */
  516. if(s->num_available_buffers>=2 || (!s->has_b_frames))
  517. *data_size = sizeof(AVPicture);
  518. #ifdef PRINT_FRAME_TIME
  519. printf("%Ld\n", rdtsc()-time);
  520. #endif
  521. return get_consumed_bytes(s, buf_size);
  522. }
  523. AVCodec mpeg4_decoder = {
  524. "mpeg4",
  525. CODEC_TYPE_VIDEO,
  526. CODEC_ID_MPEG4,
  527. sizeof(MpegEncContext),
  528. h263_decode_init,
  529. NULL,
  530. h263_decode_end,
  531. h263_decode_frame,
  532. CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
  533. };
  534. AVCodec h263_decoder = {
  535. "h263",
  536. CODEC_TYPE_VIDEO,
  537. CODEC_ID_H263,
  538. sizeof(MpegEncContext),
  539. h263_decode_init,
  540. NULL,
  541. h263_decode_end,
  542. h263_decode_frame,
  543. CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
  544. };
  545. AVCodec msmpeg4v1_decoder = {
  546. "msmpeg4v1",
  547. CODEC_TYPE_VIDEO,
  548. CODEC_ID_MSMPEG4V1,
  549. sizeof(MpegEncContext),
  550. h263_decode_init,
  551. NULL,
  552. h263_decode_end,
  553. h263_decode_frame,
  554. CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
  555. };
  556. AVCodec msmpeg4v2_decoder = {
  557. "msmpeg4v2",
  558. CODEC_TYPE_VIDEO,
  559. CODEC_ID_MSMPEG4V2,
  560. sizeof(MpegEncContext),
  561. h263_decode_init,
  562. NULL,
  563. h263_decode_end,
  564. h263_decode_frame,
  565. CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
  566. };
  567. AVCodec msmpeg4v3_decoder = {
  568. "msmpeg4",
  569. CODEC_TYPE_VIDEO,
  570. CODEC_ID_MSMPEG4V3,
  571. sizeof(MpegEncContext),
  572. h263_decode_init,
  573. NULL,
  574. h263_decode_end,
  575. h263_decode_frame,
  576. CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
  577. };
  578. AVCodec wmv1_decoder = {
  579. "wmv1",
  580. CODEC_TYPE_VIDEO,
  581. CODEC_ID_WMV1,
  582. sizeof(MpegEncContext),
  583. h263_decode_init,
  584. NULL,
  585. h263_decode_end,
  586. h263_decode_frame,
  587. CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
  588. };
  589. AVCodec wmv2_decoder = {
  590. "wmv2",
  591. CODEC_TYPE_VIDEO,
  592. CODEC_ID_WMV2,
  593. sizeof(MpegEncContext),
  594. h263_decode_init,
  595. NULL,
  596. h263_decode_end,
  597. h263_decode_frame,
  598. CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
  599. };
  600. AVCodec h263i_decoder = {
  601. "h263i",
  602. CODEC_TYPE_VIDEO,
  603. CODEC_ID_H263I,
  604. sizeof(MpegEncContext),
  605. h263_decode_init,
  606. NULL,
  607. h263_decode_end,
  608. h263_decode_frame,
  609. CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
  610. };