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.

665 lines
19KB

  1. /*
  2. * H261 decoder
  3. * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
  4. * Copyright (c) 2004 Maarten Daniels
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. /**
  23. * @file
  24. * H.261 decoder.
  25. */
  26. #include "libavutil/avassert.h"
  27. #include "dsputil.h"
  28. #include "avcodec.h"
  29. #include "mpegvideo.h"
  30. #include "h263.h"
  31. #include "h261.h"
  32. #include "h261data.h"
  33. #define H261_MBA_VLC_BITS 9
  34. #define H261_MTYPE_VLC_BITS 6
  35. #define H261_MV_VLC_BITS 7
  36. #define H261_CBP_VLC_BITS 9
  37. #define TCOEFF_VLC_BITS 9
  38. #define MBA_STUFFING 33
  39. #define MBA_STARTCODE 34
  40. extern uint8_t ff_h261_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3];
  41. static VLC h261_mba_vlc;
  42. static VLC h261_mtype_vlc;
  43. static VLC h261_mv_vlc;
  44. static VLC h261_cbp_vlc;
  45. static int h261_decode_block(H261Context * h, DCTELEM * block, int n, int coded);
  46. static av_cold void h261_decode_init_vlc(H261Context *h){
  47. static int done = 0;
  48. if(!done){
  49. done = 1;
  50. INIT_VLC_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35,
  51. ff_h261_mba_bits, 1, 1,
  52. ff_h261_mba_code, 1, 1, 662);
  53. INIT_VLC_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10,
  54. ff_h261_mtype_bits, 1, 1,
  55. ff_h261_mtype_code, 1, 1, 80);
  56. INIT_VLC_STATIC(&h261_mv_vlc, H261_MV_VLC_BITS, 17,
  57. &ff_h261_mv_tab[0][1], 2, 1,
  58. &ff_h261_mv_tab[0][0], 2, 1, 144);
  59. INIT_VLC_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63,
  60. &ff_h261_cbp_tab[0][1], 2, 1,
  61. &ff_h261_cbp_tab[0][0], 2, 1, 512);
  62. ff_init_rl(&ff_h261_rl_tcoeff, ff_h261_rl_table_store);
  63. INIT_VLC_RL(ff_h261_rl_tcoeff, 552);
  64. }
  65. }
  66. static av_cold int h261_decode_init(AVCodecContext *avctx){
  67. H261Context *h= avctx->priv_data;
  68. MpegEncContext * const s = &h->s;
  69. // set defaults
  70. ff_MPV_decode_defaults(s);
  71. s->avctx = avctx;
  72. s->width = s->avctx->coded_width;
  73. s->height = s->avctx->coded_height;
  74. s->codec_id = s->avctx->codec->id;
  75. s->out_format = FMT_H261;
  76. s->low_delay= 1;
  77. avctx->pix_fmt= PIX_FMT_YUV420P;
  78. s->codec_id= avctx->codec->id;
  79. h261_decode_init_vlc(h);
  80. h->gob_start_code_skipped = 0;
  81. return 0;
  82. }
  83. /**
  84. * Decode the group of blocks header or slice header.
  85. * @return <0 if an error occurred
  86. */
  87. static int h261_decode_gob_header(H261Context *h){
  88. unsigned int val;
  89. MpegEncContext * const s = &h->s;
  90. if ( !h->gob_start_code_skipped ){
  91. /* Check for GOB Start Code */
  92. val = show_bits(&s->gb, 15);
  93. if(val)
  94. return -1;
  95. /* We have a GBSC */
  96. skip_bits(&s->gb, 16);
  97. }
  98. h->gob_start_code_skipped = 0;
  99. h->gob_number = get_bits(&s->gb, 4); /* GN */
  100. s->qscale = get_bits(&s->gb, 5); /* GQUANT */
  101. /* Check if gob_number is valid */
  102. if (s->mb_height==18){ //cif
  103. if ((h->gob_number<=0) || (h->gob_number>12))
  104. return -1;
  105. }
  106. else{ //qcif
  107. if ((h->gob_number!=1) && (h->gob_number!=3) && (h->gob_number!=5))
  108. return -1;
  109. }
  110. /* GEI */
  111. while (get_bits1(&s->gb) != 0) {
  112. skip_bits(&s->gb, 8);
  113. }
  114. if(s->qscale==0) {
  115. av_log(s->avctx, AV_LOG_ERROR, "qscale has forbidden 0 value\n");
  116. if (s->avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_COMPLIANT))
  117. return -1;
  118. }
  119. // For the first transmitted macroblock in a GOB, MBA is the absolute address. For
  120. // subsequent macroblocks, MBA is the difference between the absolute addresses of
  121. // the macroblock and the last transmitted macroblock.
  122. h->current_mba = 0;
  123. h->mba_diff = 0;
  124. return 0;
  125. }
  126. /**
  127. * Decode the group of blocks / video packet header.
  128. * @return <0 if no resync found
  129. */
  130. static int ff_h261_resync(H261Context *h){
  131. MpegEncContext * const s = &h->s;
  132. int left, ret;
  133. if ( h->gob_start_code_skipped ){
  134. ret= h261_decode_gob_header(h);
  135. if(ret>=0)
  136. return 0;
  137. }
  138. else{
  139. if(show_bits(&s->gb, 15)==0){
  140. ret= h261_decode_gob_header(h);
  141. if(ret>=0)
  142. return 0;
  143. }
  144. //OK, it is not where it is supposed to be ...
  145. s->gb= s->last_resync_gb;
  146. align_get_bits(&s->gb);
  147. left= get_bits_left(&s->gb);
  148. for(;left>15+1+4+5; left-=8){
  149. if(show_bits(&s->gb, 15)==0){
  150. GetBitContext bak= s->gb;
  151. ret= h261_decode_gob_header(h);
  152. if(ret>=0)
  153. return 0;
  154. s->gb= bak;
  155. }
  156. skip_bits(&s->gb, 8);
  157. }
  158. }
  159. return -1;
  160. }
  161. /**
  162. * Decode skipped macroblocks.
  163. * @return 0
  164. */
  165. static int h261_decode_mb_skipped(H261Context *h, int mba1, int mba2 )
  166. {
  167. MpegEncContext * const s = &h->s;
  168. int i;
  169. s->mb_intra = 0;
  170. for(i=mba1; i<mba2; i++){
  171. int j, xy;
  172. s->mb_x= ((h->gob_number-1) % 2) * 11 + i % 11;
  173. s->mb_y= ((h->gob_number-1) / 2) * 3 + i / 11;
  174. xy = s->mb_x + s->mb_y * s->mb_stride;
  175. ff_init_block_index(s);
  176. ff_update_block_index(s);
  177. for(j=0;j<6;j++)
  178. s->block_last_index[j] = -1;
  179. s->mv_dir = MV_DIR_FORWARD;
  180. s->mv_type = MV_TYPE_16X16;
  181. s->current_picture.f.mb_type[xy] = MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_L0;
  182. s->mv[0][0][0] = 0;
  183. s->mv[0][0][1] = 0;
  184. s->mb_skipped = 1;
  185. h->mtype &= ~MB_TYPE_H261_FIL;
  186. ff_MPV_decode_mb(s, s->block);
  187. }
  188. return 0;
  189. }
  190. static int decode_mv_component(GetBitContext *gb, int v){
  191. static const int mvmap[17] = {
  192. 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16
  193. };
  194. int mv_diff = get_vlc2(gb, h261_mv_vlc.table, H261_MV_VLC_BITS, 2);
  195. /* check if mv_diff is valid */
  196. if ( mv_diff < 0 )
  197. return v;
  198. mv_diff = mvmap[mv_diff];
  199. if(mv_diff && !get_bits1(gb))
  200. mv_diff= -mv_diff;
  201. v += mv_diff;
  202. if (v <=-16) v+= 32;
  203. else if(v >= 16) v-= 32;
  204. return v;
  205. }
  206. static int h261_decode_mb(H261Context *h){
  207. MpegEncContext * const s = &h->s;
  208. int i, cbp, xy;
  209. cbp = 63;
  210. // Read mba
  211. do{
  212. h->mba_diff = get_vlc2(&s->gb, h261_mba_vlc.table, H261_MBA_VLC_BITS, 2);
  213. /* Check for slice end */
  214. /* NOTE: GOB can be empty (no MB data) or exist only of MBA_stuffing */
  215. if (h->mba_diff == MBA_STARTCODE){ // start code
  216. h->gob_start_code_skipped = 1;
  217. return SLICE_END;
  218. }
  219. }
  220. while( h->mba_diff == MBA_STUFFING ); // stuffing
  221. if ( h->mba_diff < 0 ){
  222. if (get_bits_left(&s->gb) <= 7)
  223. return SLICE_END;
  224. av_log(s->avctx, AV_LOG_ERROR, "illegal mba at %d %d\n", s->mb_x, s->mb_y);
  225. return SLICE_ERROR;
  226. }
  227. h->mba_diff += 1;
  228. h->current_mba += h->mba_diff;
  229. if ( h->current_mba > MBA_STUFFING )
  230. return SLICE_ERROR;
  231. s->mb_x= ((h->gob_number-1) % 2) * 11 + ((h->current_mba-1) % 11);
  232. s->mb_y= ((h->gob_number-1) / 2) * 3 + ((h->current_mba-1) / 11);
  233. xy = s->mb_x + s->mb_y * s->mb_stride;
  234. ff_init_block_index(s);
  235. ff_update_block_index(s);
  236. // Read mtype
  237. h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2);
  238. if (h->mtype < 0) {
  239. av_log(s->avctx, AV_LOG_ERROR, "illegal mtype %d\n", h->mtype);
  240. return SLICE_ERROR;
  241. }
  242. h->mtype = ff_h261_mtype_map[h->mtype];
  243. // Read mquant
  244. if ( IS_QUANT ( h->mtype ) ){
  245. ff_set_qscale(s, get_bits(&s->gb, 5));
  246. }
  247. s->mb_intra = IS_INTRA4x4(h->mtype);
  248. // Read mv
  249. if ( IS_16X16 ( h->mtype ) ){
  250. // Motion vector data is included for all MC macroblocks. MVD is obtained from the macroblock vector by subtracting the
  251. // vector of the preceding macroblock. For this calculation the vector of the preceding macroblock is regarded as zero in the
  252. // following three situations:
  253. // 1) evaluating MVD for macroblocks 1, 12 and 23;
  254. // 2) evaluating MVD for macroblocks in which MBA does not represent a difference of 1;
  255. // 3) MTYPE of the previous macroblock was not MC.
  256. if ( ( h->current_mba == 1 ) || ( h->current_mba == 12 ) || ( h->current_mba == 23 ) ||
  257. ( h->mba_diff != 1))
  258. {
  259. h->current_mv_x = 0;
  260. h->current_mv_y = 0;
  261. }
  262. h->current_mv_x= decode_mv_component(&s->gb, h->current_mv_x);
  263. h->current_mv_y= decode_mv_component(&s->gb, h->current_mv_y);
  264. }else{
  265. h->current_mv_x = 0;
  266. h->current_mv_y = 0;
  267. }
  268. // Read cbp
  269. if ( HAS_CBP( h->mtype ) ){
  270. cbp = get_vlc2(&s->gb, h261_cbp_vlc.table, H261_CBP_VLC_BITS, 2) + 1;
  271. }
  272. if(s->mb_intra){
  273. s->current_picture.f.mb_type[xy] = MB_TYPE_INTRA;
  274. goto intra;
  275. }
  276. //set motion vectors
  277. s->mv_dir = MV_DIR_FORWARD;
  278. s->mv_type = MV_TYPE_16X16;
  279. s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
  280. s->mv[0][0][0] = h->current_mv_x * 2;//gets divided by 2 in motion compensation
  281. s->mv[0][0][1] = h->current_mv_y * 2;
  282. intra:
  283. /* decode each block */
  284. if(s->mb_intra || HAS_CBP(h->mtype)){
  285. s->dsp.clear_blocks(s->block[0]);
  286. for (i = 0; i < 6; i++) {
  287. if (h261_decode_block(h, s->block[i], i, cbp&32) < 0){
  288. return SLICE_ERROR;
  289. }
  290. cbp+=cbp;
  291. }
  292. }else{
  293. for (i = 0; i < 6; i++)
  294. s->block_last_index[i]= -1;
  295. }
  296. ff_MPV_decode_mb(s, s->block);
  297. return SLICE_OK;
  298. }
  299. /**
  300. * Decode a macroblock.
  301. * @return <0 if an error occurred
  302. */
  303. static int h261_decode_block(H261Context * h, DCTELEM * block,
  304. int n, int coded)
  305. {
  306. MpegEncContext * const s = &h->s;
  307. int code, level, i, j, run;
  308. RLTable *rl = &ff_h261_rl_tcoeff;
  309. const uint8_t *scan_table;
  310. // For the variable length encoding there are two code tables, one being used for
  311. // the first transmitted LEVEL in INTER, INTER+MC and INTER+MC+FIL blocks, the second
  312. // for all other LEVELs except the first one in INTRA blocks which is fixed length
  313. // coded with 8 bits.
  314. // NOTE: the two code tables only differ in one VLC so we handle that manually.
  315. scan_table = s->intra_scantable.permutated;
  316. if (s->mb_intra){
  317. /* DC coef */
  318. level = get_bits(&s->gb, 8);
  319. // 0 (00000000b) and -128 (10000000b) are FORBIDDEN
  320. if((level&0x7F) == 0){
  321. av_log(s->avctx, AV_LOG_ERROR, "illegal dc %d at %d %d\n", level, s->mb_x, s->mb_y);
  322. return -1;
  323. }
  324. // The code 1000 0000 is not used, the reconstruction level of 1024 being coded as 1111 1111.
  325. if (level == 255)
  326. level = 128;
  327. block[0] = level;
  328. i = 1;
  329. }else if(coded){
  330. // Run Level Code
  331. // EOB Not possible for first level when cbp is available (that's why the table is different)
  332. // 0 1 1s
  333. // * * 0*
  334. int check = show_bits(&s->gb, 2);
  335. i = 0;
  336. if ( check & 0x2 ){
  337. skip_bits(&s->gb, 2);
  338. block[0] = ( check & 0x1 ) ? -1 : 1;
  339. i = 1;
  340. }
  341. }else{
  342. i = 0;
  343. }
  344. if(!coded){
  345. s->block_last_index[n] = i - 1;
  346. return 0;
  347. }
  348. for(;;){
  349. code = get_vlc2(&s->gb, rl->vlc.table, TCOEFF_VLC_BITS, 2);
  350. if (code < 0){
  351. av_log(s->avctx, AV_LOG_ERROR, "illegal ac vlc code at %dx%d\n", s->mb_x, s->mb_y);
  352. return -1;
  353. }
  354. if (code == rl->n) {
  355. /* escape */
  356. // The remaining combinations of (run, level) are encoded with a 20-bit word consisting of 6 bits escape, 6 bits run and 8 bits level.
  357. run = get_bits(&s->gb, 6);
  358. level = get_sbits(&s->gb, 8);
  359. }else if(code == 0){
  360. break;
  361. }else{
  362. run = rl->table_run[code];
  363. level = rl->table_level[code];
  364. if (get_bits1(&s->gb))
  365. level = -level;
  366. }
  367. i += run;
  368. if (i >= 64){
  369. av_log(s->avctx, AV_LOG_ERROR, "run overflow at %dx%d\n", s->mb_x, s->mb_y);
  370. return -1;
  371. }
  372. j = scan_table[i];
  373. block[j] = level;
  374. i++;
  375. }
  376. s->block_last_index[n] = i-1;
  377. return 0;
  378. }
  379. /**
  380. * Decode the H.261 picture header.
  381. * @return <0 if no startcode found
  382. */
  383. static int h261_decode_picture_header(H261Context *h){
  384. MpegEncContext * const s = &h->s;
  385. int format, i;
  386. uint32_t startcode= 0;
  387. for(i= get_bits_left(&s->gb); i>24; i-=1){
  388. startcode = ((startcode << 1) | get_bits(&s->gb, 1)) & 0x000FFFFF;
  389. if(startcode == 0x10)
  390. break;
  391. }
  392. if (startcode != 0x10){
  393. av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
  394. return -1;
  395. }
  396. /* temporal reference */
  397. i= get_bits(&s->gb, 5); /* picture timestamp */
  398. if(i < (s->picture_number&31))
  399. i += 32;
  400. s->picture_number = (s->picture_number&~31) + i;
  401. s->avctx->time_base= (AVRational){1001, 30000};
  402. s->current_picture.f.pts = s->picture_number;
  403. /* PTYPE starts here */
  404. skip_bits1(&s->gb); /* split screen off */
  405. skip_bits1(&s->gb); /* camera off */
  406. skip_bits1(&s->gb); /* freeze picture release off */
  407. format = get_bits1(&s->gb);
  408. //only 2 formats possible
  409. if (format == 0){//QCIF
  410. s->width = 176;
  411. s->height = 144;
  412. s->mb_width = 11;
  413. s->mb_height = 9;
  414. }else{//CIF
  415. s->width = 352;
  416. s->height = 288;
  417. s->mb_width = 22;
  418. s->mb_height = 18;
  419. }
  420. s->mb_num = s->mb_width * s->mb_height;
  421. skip_bits1(&s->gb); /* still image mode off */
  422. skip_bits1(&s->gb); /* Reserved */
  423. /* PEI */
  424. while (get_bits1(&s->gb) != 0){
  425. skip_bits(&s->gb, 8);
  426. }
  427. // h261 has no I-FRAMES, but if we pass AV_PICTURE_TYPE_I for the first frame, the codec crashes if it does
  428. // not contain all I-blocks (e.g. when a packet is lost)
  429. s->pict_type = AV_PICTURE_TYPE_P;
  430. h->gob_number = 0;
  431. return 0;
  432. }
  433. static int h261_decode_gob(H261Context *h){
  434. MpegEncContext * const s = &h->s;
  435. ff_set_qscale(s, s->qscale);
  436. /* decode mb's */
  437. while(h->current_mba <= MBA_STUFFING)
  438. {
  439. int ret;
  440. /* DCT & quantize */
  441. ret= h261_decode_mb(h);
  442. if(ret<0){
  443. if(ret==SLICE_END){
  444. h261_decode_mb_skipped(h, h->current_mba, 33);
  445. return 0;
  446. }
  447. av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n", s->mb_x + s->mb_y*s->mb_stride);
  448. return -1;
  449. }
  450. h261_decode_mb_skipped(h, h->current_mba-h->mba_diff, h->current_mba-1);
  451. }
  452. return -1;
  453. }
  454. /**
  455. * returns the number of bytes consumed for building the current frame
  456. */
  457. static int get_consumed_bytes(MpegEncContext *s, int buf_size){
  458. int pos= get_bits_count(&s->gb)>>3;
  459. if(pos==0) pos=1; //avoid infinite loops (i doubt that is needed but ...)
  460. if(pos+10>buf_size) pos=buf_size; // oops ;)
  461. return pos;
  462. }
  463. static int h261_decode_frame(AVCodecContext *avctx,
  464. void *data, int *data_size,
  465. AVPacket *avpkt)
  466. {
  467. const uint8_t *buf = avpkt->data;
  468. int buf_size = avpkt->size;
  469. H261Context *h= avctx->priv_data;
  470. MpegEncContext *s = &h->s;
  471. int ret;
  472. AVFrame *pict = data;
  473. av_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
  474. av_dlog(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
  475. s->flags= avctx->flags;
  476. s->flags2= avctx->flags2;
  477. h->gob_start_code_skipped=0;
  478. retry:
  479. init_get_bits(&s->gb, buf, buf_size*8);
  480. if(!s->context_initialized){
  481. if (ff_MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
  482. return -1;
  483. }
  484. //we need to set current_picture_ptr before reading the header, otherwise we cannot store anyting im there
  485. if (s->current_picture_ptr == NULL || s->current_picture_ptr->f.data[0]) {
  486. int i= ff_find_unused_picture(s, 0);
  487. if (i < 0)
  488. return i;
  489. s->current_picture_ptr= &s->picture[i];
  490. }
  491. ret = h261_decode_picture_header(h);
  492. /* skip if the header was thrashed */
  493. if (ret < 0){
  494. av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
  495. return -1;
  496. }
  497. if (s->width != avctx->coded_width || s->height != avctx->coded_height){
  498. ParseContext pc= s->parse_context; //FIXME move this demuxing hack to libavformat
  499. s->parse_context.buffer=0;
  500. ff_MPV_common_end(s);
  501. s->parse_context= pc;
  502. }
  503. if (!s->context_initialized) {
  504. avcodec_set_dimensions(avctx, s->width, s->height);
  505. goto retry;
  506. }
  507. // for skipping the frame
  508. s->current_picture.f.pict_type = s->pict_type;
  509. s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
  510. if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
  511. ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
  512. || avctx->skip_frame >= AVDISCARD_ALL)
  513. return get_consumed_bytes(s, buf_size);
  514. if(ff_MPV_frame_start(s, avctx) < 0)
  515. return -1;
  516. ff_er_frame_start(s);
  517. /* decode each macroblock */
  518. s->mb_x=0;
  519. s->mb_y=0;
  520. while(h->gob_number < (s->mb_height==18 ? 12 : 5)){
  521. if(ff_h261_resync(h)<0)
  522. break;
  523. h261_decode_gob(h);
  524. }
  525. ff_MPV_frame_end(s);
  526. av_assert0(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type);
  527. av_assert0(s->current_picture.f.pict_type == s->pict_type);
  528. *pict = s->current_picture_ptr->f;
  529. ff_print_debug_info(s, pict);
  530. *data_size = sizeof(AVFrame);
  531. return get_consumed_bytes(s, buf_size);
  532. }
  533. static av_cold int h261_decode_end(AVCodecContext *avctx)
  534. {
  535. H261Context *h= avctx->priv_data;
  536. MpegEncContext *s = &h->s;
  537. ff_MPV_common_end(s);
  538. return 0;
  539. }
  540. AVCodec ff_h261_decoder = {
  541. .name = "h261",
  542. .type = AVMEDIA_TYPE_VIDEO,
  543. .id = AV_CODEC_ID_H261,
  544. .priv_data_size = sizeof(H261Context),
  545. .init = h261_decode_init,
  546. .close = h261_decode_end,
  547. .decode = h261_decode_frame,
  548. .capabilities = CODEC_CAP_DR1,
  549. .max_lowres = 3,
  550. .long_name = NULL_IF_CONFIG_SMALL("H.261"),
  551. };