FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
h263dec.c
Go to the documentation of this file.
1 /*
2  * H.263 decoder
3  * Copyright (c) 2001 Fabrice Bellard
4  * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
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 /**
24  * @file
25  * H.263 decoder.
26  */
27 
28 #define UNCHECKED_BITSTREAM_READER 1
29 
30 #include "libavutil/cpu.h"
31 #include "avcodec.h"
32 #include "error_resilience.h"
33 #include "flv.h"
34 #include "h263.h"
35 #include "h263_parser.h"
36 #include "internal.h"
37 #include "mpeg_er.h"
38 #include "mpeg4video.h"
39 #include "mpeg4video_parser.h"
40 #include "mpegvideo.h"
41 #include "msmpeg4.h"
42 #include "qpeldsp.h"
43 #include "vdpau_internal.h"
44 #include "thread.h"
45 
47 {
48  MpegEncContext *s = avctx->priv_data;
49  int ret;
50 
51  s->avctx = avctx;
52  s->out_format = FMT_H263;
53  s->width = avctx->coded_width;
54  s->height = avctx->coded_height;
55  s->workaround_bugs = avctx->workaround_bugs;
56 
57  // set defaults
59  s->quant_precision = 5;
61  s->low_delay = 1;
62  if (avctx->codec->id == AV_CODEC_ID_MSS2)
63  avctx->pix_fmt = AV_PIX_FMT_YUV420P;
64  else
65  avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
66  s->unrestricted_mv = 1;
67 
68  /* select sub codec */
69  switch (avctx->codec->id) {
70  case AV_CODEC_ID_H263:
71  case AV_CODEC_ID_H263P:
72  s->unrestricted_mv = 0;
74  break;
75  case AV_CODEC_ID_MPEG4:
76  break;
78  s->h263_pred = 1;
79  s->msmpeg4_version = 1;
80  break;
82  s->h263_pred = 1;
83  s->msmpeg4_version = 2;
84  break;
86  s->h263_pred = 1;
87  s->msmpeg4_version = 3;
88  break;
89  case AV_CODEC_ID_WMV1:
90  s->h263_pred = 1;
91  s->msmpeg4_version = 4;
92  break;
93  case AV_CODEC_ID_WMV2:
94  s->h263_pred = 1;
95  s->msmpeg4_version = 5;
96  break;
97  case AV_CODEC_ID_VC1:
98  case AV_CODEC_ID_WMV3:
101  case AV_CODEC_ID_MSS2:
102  s->h263_pred = 1;
103  s->msmpeg4_version = 6;
105  break;
106  case AV_CODEC_ID_H263I:
107  break;
108  case AV_CODEC_ID_FLV1:
109  s->h263_flv = 1;
110  break;
111  default:
112  av_log(avctx, AV_LOG_ERROR, "Unsupported codec %d\n",
113  avctx->codec->id);
114  return AVERROR(ENOSYS);
115  }
116  s->codec_id = avctx->codec->id;
117 
118  if (avctx->stream_codec_tag == AV_RL32("l263") && avctx->extradata_size == 56 && avctx->extradata[0] == 1)
119  s->ehc_mode = 1;
120 
121  /* for h263, we allocate the images after having read the header */
122  if (avctx->codec->id != AV_CODEC_ID_H263 &&
123  avctx->codec->id != AV_CODEC_ID_H263P &&
124  avctx->codec->id != AV_CODEC_ID_MPEG4)
125  if ((ret = ff_MPV_common_init(s)) < 0)
126  return ret;
127 
129  ff_qpeldsp_init(&s->qdsp);
131 
132  return 0;
133 }
134 
136 {
137  MpegEncContext *s = avctx->priv_data;
138 
140  return 0;
141 }
142 
143 /**
144  * Return the number of bytes consumed for building the current frame.
145  */
146 static int get_consumed_bytes(MpegEncContext *s, int buf_size)
147 {
148  int pos = (get_bits_count(&s->gb) + 7) >> 3;
149 
150  if (s->divx_packed || s->avctx->hwaccel) {
151  /* We would have to scan through the whole buf to handle the weird
152  * reordering ... */
153  return buf_size;
154  } else if (s->flags & CODEC_FLAG_TRUNCATED) {
155  pos -= s->parse_context.last_index;
156  // padding is not really read so this might be -1
157  if (pos < 0)
158  pos = 0;
159  return pos;
160  } else {
161  // avoid infinite loops (maybe not needed...)
162  if (pos == 0)
163  pos = 1;
164  // oops ;)
165  if (pos + 10 > buf_size)
166  pos = buf_size;
167 
168  return pos;
169  }
170 }
171 
173 {
174  const int part_mask = s->partitioned_frame
175  ? (ER_AC_END | ER_AC_ERROR) : 0x7F;
176  const int mb_size = 16 >> s->avctx->lowres;
177  int ret;
178 
179  s->last_resync_gb = s->gb;
180  s->first_slice_line = 1;
181  s->resync_mb_x = s->mb_x;
182  s->resync_mb_y = s->mb_y;
183 
184  ff_set_qscale(s, s->qscale);
185 
186  if (s->avctx->hwaccel) {
187  const uint8_t *start = s->gb.buffer + get_bits_count(&s->gb) / 8;
188  ret = s->avctx->hwaccel->decode_slice(s->avctx, start, s->gb.buffer_end - start);
189  // ensure we exit decode loop
190  s->mb_y = s->mb_height;
191  return ret;
192  }
193 
194  if (s->partitioned_frame) {
195  const int qscale = s->qscale;
196 
197  if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4)
198  if ((ret = ff_mpeg4_decode_partitions(s->avctx->priv_data)) < 0)
199  return ret;
200 
201  /* restore variables which were modified */
202  s->first_slice_line = 1;
203  s->mb_x = s->resync_mb_x;
204  s->mb_y = s->resync_mb_y;
205  ff_set_qscale(s, qscale);
206  }
207 
208  for (; s->mb_y < s->mb_height; s->mb_y++) {
209  /* per-row end of slice checks */
210  if (s->msmpeg4_version) {
211  if (s->resync_mb_y + s->slice_height == s->mb_y) {
213  s->mb_x - 1, s->mb_y, ER_MB_END);
214 
215  return 0;
216  }
217  }
218 
219  if (s->msmpeg4_version == 1) {
220  s->last_dc[0] =
221  s->last_dc[1] =
222  s->last_dc[2] = 128;
223  }
224 
226  for (; s->mb_x < s->mb_width; s->mb_x++) {
227  int ret;
228 
230 
231  if (s->resync_mb_x == s->mb_x && s->resync_mb_y + 1 == s->mb_y)
232  s->first_slice_line = 0;
233 
234  /* DCT & quantize */
235 
236  s->mv_dir = MV_DIR_FORWARD;
237  s->mv_type = MV_TYPE_16X16;
238  av_dlog(s, "%d %d %06X\n",
239  ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
240 
241  tprintf(NULL, "Decoding MB at %dx%d\n", s->mb_x, s->mb_y);
242  ret = s->decode_mb(s, s->block);
243 
244  if (s->pict_type != AV_PICTURE_TYPE_B)
246 
247  if (ret < 0) {
248  const int xy = s->mb_x + s->mb_y * s->mb_stride;
249  if (ret == SLICE_END) {
250  ff_MPV_decode_mb(s, s->block);
251  if (s->loop_filter)
253 
255  s->mb_x, s->mb_y, ER_MB_END & part_mask);
256 
257  s->padding_bug_score--;
258 
259  if (++s->mb_x >= s->mb_width) {
260  s->mb_x = 0;
261  ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
263  s->mb_y++;
264  }
265  return 0;
266  } else if (ret == SLICE_NOEND) {
268  "Slice mismatch at MB: %d\n", xy);
270  s->mb_x + 1, s->mb_y,
271  ER_MB_END & part_mask);
272  return AVERROR_INVALIDDATA;
273  }
274  av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n", xy);
276  s->mb_x, s->mb_y, ER_MB_ERROR & part_mask);
277 
279  continue;
280  return AVERROR_INVALIDDATA;
281  }
282 
283  ff_MPV_decode_mb(s, s->block);
284  if (s->loop_filter)
286  }
287 
288  ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
290 
291  s->mb_x = 0;
292  }
293 
294  av_assert1(s->mb_x == 0 && s->mb_y == s->mb_height);
295 
296  if (s->codec_id == AV_CODEC_ID_MPEG4 &&
298  get_bits_left(&s->gb) >= 48 &&
299  show_bits(&s->gb, 24) == 0x4010 &&
300  !s->data_partitioning)
301  s->padding_bug_score += 32;
302 
303  /* try to detect the padding bug */
304  if (s->codec_id == AV_CODEC_ID_MPEG4 &&
306  get_bits_left(&s->gb) >= 0 &&
307  get_bits_left(&s->gb) < 137 &&
308  !s->data_partitioning) {
309  const int bits_count = get_bits_count(&s->gb);
310  const int bits_left = s->gb.size_in_bits - bits_count;
311 
312  if (bits_left == 0) {
313  s->padding_bug_score += 16;
314  } else if (bits_left != 1) {
315  int v = show_bits(&s->gb, 8);
316  v |= 0x7F >> (7 - (bits_count & 7));
317 
318  if (v == 0x7F && bits_left <= 8)
319  s->padding_bug_score--;
320  else if (v == 0x7F && ((get_bits_count(&s->gb) + 8) & 8) &&
321  bits_left <= 16)
322  s->padding_bug_score += 4;
323  else
324  s->padding_bug_score++;
325  }
326  }
327 
328  if (s->codec_id == AV_CODEC_ID_H263 &&
330  get_bits_left(&s->gb) >= 8 &&
331  get_bits_left(&s->gb) < 300 &&
333  show_bits(&s->gb, 8) == 0 &&
334  !s->data_partitioning) {
335 
336  s->padding_bug_score += 32;
337  }
338 
340  if (s->padding_bug_score > -2 && !s->data_partitioning)
342  else
344  }
345 
346  // handle formats which don't have unique end markers
347  if (s->msmpeg4_version || (s->workaround_bugs & FF_BUG_NO_PADDING)) { // FIXME perhaps solve this more cleanly
348  int left = get_bits_left(&s->gb);
349  int max_extra = 7;
350 
351  /* no markers in M$ crap */
353  max_extra += 17;
354 
355  /* buggy padding but the frame should still end approximately at
356  * the bitstream end */
357  if ((s->workaround_bugs & FF_BUG_NO_PADDING) &&
359  max_extra += 48;
360  else if ((s->workaround_bugs & FF_BUG_NO_PADDING))
361  max_extra += 256 * 256 * 256 * 64;
362 
363  if (left > max_extra)
365  "discarding %d junk bits at end, next would be %X\n",
366  left, show_bits(&s->gb, 24));
367  else if (left < 0)
368  av_log(s->avctx, AV_LOG_ERROR, "overreading %d bits\n", -left);
369  else
371  s->mb_x - 1, s->mb_y, ER_MB_END);
372 
373  return 0;
374  }
375 
377  "slice end not reached but screenspace end (%d left %06X, score= %d)\n",
378  get_bits_left(&s->gb), show_bits(&s->gb, 24), s->padding_bug_score);
379 
380  ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y,
381  ER_MB_END & part_mask);
382 
383  return AVERROR_INVALIDDATA;
384 }
385 
386 int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
387  AVPacket *avpkt)
388 {
389  const uint8_t *buf = avpkt->data;
390  int buf_size = avpkt->size;
391  MpegEncContext *s = avctx->priv_data;
392  int ret;
393  int slice_ret = 0;
394  AVFrame *pict = data;
395 
396  s->flags = avctx->flags;
397  s->flags2 = avctx->flags2;
398 
399  /* no supplementary picture */
400  if (buf_size == 0) {
401  /* special case for last picture */
402  if (s->low_delay == 0 && s->next_picture_ptr) {
403  if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0)
404  return ret;
405  s->next_picture_ptr = NULL;
406 
407  *got_frame = 1;
408  }
409 
410  return 0;
411  }
412 
413  if (s->flags & CODEC_FLAG_TRUNCATED) {
414  int next;
415 
416  if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4) {
417  next = ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size);
418  } else if (CONFIG_H263_DECODER && s->codec_id == AV_CODEC_ID_H263) {
419  next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size);
420  } else if (CONFIG_H263P_DECODER && s->codec_id == AV_CODEC_ID_H263P) {
421  next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size);
422  } else {
424  "this codec does not support truncated bitstreams\n");
425  return AVERROR(ENOSYS);
426  }
427 
428  if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf,
429  &buf_size) < 0)
430  return buf_size;
431  }
432 
433 retry:
434  if (s->divx_packed && s->bitstream_buffer_size) {
435  int i;
436  for(i=0; i < buf_size-3; i++) {
437  if (buf[i]==0 && buf[i+1]==0 && buf[i+2]==1) {
438  if (buf[i+3]==0xB0) {
439  av_log(s->avctx, AV_LOG_WARNING, "Discarding excessive bitstream in packed xvid\n");
440  s->bitstream_buffer_size = 0;
441  }
442  break;
443  }
444  }
445  }
446 
447  if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) // divx 5.01+/xvid frame reorder
448  ret = init_get_bits8(&s->gb, s->bitstream_buffer,
450  else
451  ret = init_get_bits8(&s->gb, buf, buf_size);
452 
453  s->bitstream_buffer_size = 0;
454  if (ret < 0)
455  return ret;
456 
457  if (!s->context_initialized)
458  // we need the idct permutaton for reading a custom matrix
459  if ((ret = ff_MPV_common_init(s)) < 0)
460  return ret;
461 
462  /* We need to set current_picture_ptr before reading the header,
463  * otherwise we cannot store anyting in there */
464  if (s->current_picture_ptr == NULL || s->current_picture_ptr->f->data[0]) {
465  int i = ff_find_unused_picture(s, 0);
466  if (i < 0)
467  return i;
468  s->current_picture_ptr = &s->picture[i];
469  }
470 
471  /* let's go :-) */
472  if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) {
474  } else if (CONFIG_MSMPEG4_DECODER && s->msmpeg4_version) {
476  } else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) {
477  if (s->avctx->extradata_size && s->picture_number == 0) {
478  GetBitContext gb;
479 
480  if (init_get_bits8(&gb, s->avctx->extradata, s->avctx->extradata_size) >= 0 )
482  }
483  ret = ff_mpeg4_decode_picture_header(avctx->priv_data, &s->gb);
484  } else if (CONFIG_H263I_DECODER && s->codec_id == AV_CODEC_ID_H263I) {
486  } else if (CONFIG_FLV_DECODER && s->h263_flv) {
488  } else {
490  }
491 
492  if (ret < 0 || ret == FRAME_SKIPPED) {
493  if ( s->width != avctx->coded_width
494  || s->height != avctx->coded_height) {
495  av_log(s->avctx, AV_LOG_WARNING, "Reverting picture dimensions change due to header decoding failure\n");
496  s->width = avctx->coded_width;
497  s->height= avctx->coded_height;
498  }
499  }
500  if (ret == FRAME_SKIPPED)
501  return get_consumed_bytes(s, buf_size);
502 
503  /* skip if the header was thrashed */
504  if (ret < 0) {
505  av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
506  return ret;
507  }
508 
509  avctx->has_b_frames = !s->low_delay;
510 
511  if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) {
512  if (ff_mpeg4_workaround_bugs(avctx) == 1)
513  goto retry;
514  }
515 
516  /* After H263 & mpeg4 header decode we have the height, width,
517  * and other parameters. So then we could init the picture.
518  * FIXME: By the way H263 decoder is evolving it should have
519  * an H263EncContext */
520  if (s->width != avctx->coded_width ||
521  s->height != avctx->coded_height ||
522  s->context_reinit) {
523  /* H.263 could change picture size any time */
524  s->context_reinit = 0;
525 
526  ret = ff_set_dimensions(avctx, s->width, s->height);
527  if (ret < 0)
528  return ret;
529 
530  ff_set_sar(avctx, avctx->sample_aspect_ratio);
531 
532  if ((ret = ff_MPV_common_frame_size_change(s)))
533  return ret;
534  }
535 
536  if (s->codec_id == AV_CODEC_ID_H263 ||
537  s->codec_id == AV_CODEC_ID_H263P ||
540 
541  // for skipping the frame
544 
545  /* skip B-frames if we don't have reference frames */
546  if (s->last_picture_ptr == NULL &&
547  (s->pict_type == AV_PICTURE_TYPE_B || s->droppable))
548  return get_consumed_bytes(s, buf_size);
549  if ((avctx->skip_frame >= AVDISCARD_NONREF &&
550  s->pict_type == AV_PICTURE_TYPE_B) ||
551  (avctx->skip_frame >= AVDISCARD_NONKEY &&
552  s->pict_type != AV_PICTURE_TYPE_I) ||
553  avctx->skip_frame >= AVDISCARD_ALL)
554  return get_consumed_bytes(s, buf_size);
555 
556  if (s->next_p_frame_damaged) {
557  if (s->pict_type == AV_PICTURE_TYPE_B)
558  return get_consumed_bytes(s, buf_size);
559  else
560  s->next_p_frame_damaged = 0;
561  }
562 
563  if ((!s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) {
566  } else {
569  }
570 
571  if ((ret = ff_MPV_frame_start(s, avctx)) < 0)
572  return ret;
573 
574  if (!s->divx_packed && !avctx->hwaccel)
575  ff_thread_finish_setup(avctx);
576 
577  if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) {
579  goto frame_end;
580  }
581 
582  if (avctx->hwaccel) {
583  ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer,
584  s->gb.buffer_end - s->gb.buffer);
585  if (ret < 0 )
586  return ret;
587  }
588 
590 
591  /* the second part of the wmv2 header contains the MB skip bits which
592  * are stored in current_picture->mb_type which is not available before
593  * ff_MPV_frame_start() */
594  if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) {
596  if (ret < 0)
597  return ret;
598  if (ret == 1)
599  goto frame_end;
600  }
601 
602  /* decode each macroblock */
603  s->mb_x = 0;
604  s->mb_y = 0;
605 
606  slice_ret = decode_slice(s);
607  while (s->mb_y < s->mb_height) {
608  if (s->msmpeg4_version) {
609  if (s->slice_height == 0 || s->mb_x != 0 ||
610  (s->mb_y % s->slice_height) != 0 || get_bits_left(&s->gb) < 0)
611  break;
612  } else {
613  int prev_x = s->mb_x, prev_y = s->mb_y;
614  if (ff_h263_resync(s) < 0)
615  break;
616  if (prev_y * s->mb_width + prev_x < s->mb_y * s->mb_width + s->mb_x)
617  s->er.error_occurred = 1;
618  }
619 
620  if (s->msmpeg4_version < 4 && s->h263_pred)
622 
623  if (decode_slice(s) < 0)
624  slice_ret = AVERROR_INVALIDDATA;
625  }
626 
627  if (s->msmpeg4_version && s->msmpeg4_version < 4 &&
629  if (!CONFIG_MSMPEG4_DECODER ||
630  ff_msmpeg4_decode_ext_header(s, buf_size) < 0)
632 
634 frame_end:
635  ff_er_frame_end(&s->er);
636 
637  if (avctx->hwaccel) {
638  ret = avctx->hwaccel->end_frame(avctx);
639  if (ret < 0)
640  return ret;
641  }
642 
643  ff_MPV_frame_end(s);
644 
645  if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4)
646  ff_mpeg4_frame_end(avctx, buf, buf_size);
647 
648  if (!s->divx_packed && avctx->hwaccel)
649  ff_thread_finish_setup(avctx);
650 
653  if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
654  if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
655  return ret;
658  } else if (s->last_picture_ptr != NULL) {
659  if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
660  return ret;
663  }
664 
665  if (s->last_picture_ptr || s->low_delay) {
666  if ( pict->format == AV_PIX_FMT_YUV420P
667  && (s->codec_tag == AV_RL32("GEOV") || s->codec_tag == AV_RL32("GEOX"))) {
668  int x, y, p;
670  for (p=0; p<3; p++) {
671  int w = FF_CEIL_RSHIFT(pict-> width, !!p);
672  int h = FF_CEIL_RSHIFT(pict->height, !!p);
673  int linesize = pict->linesize[p];
674  for (y=0; y<(h>>1); y++)
675  for (x=0; x<w; x++)
676  FFSWAP(int,
677  pict->data[p][x + y*linesize],
678  pict->data[p][x + (h-1-y)*linesize]);
679  }
680  }
681  *got_frame = 1;
682  }
683 
684  if (slice_ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
685  return ret;
686  else
687  return get_consumed_bytes(s, buf_size);
688 }
689 
691 #if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL
693 #endif
694 #if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL
696 #endif
699 };
700 
702  .name = "h263",
703  .long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"),
704  .type = AVMEDIA_TYPE_VIDEO,
705  .id = AV_CODEC_ID_H263,
706  .priv_data_size = sizeof(MpegEncContext),
710  .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
712  .flush = ff_mpeg_flush,
713  .max_lowres = 3,
715 };
716 
718  .name = "h263p",
719  .long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"),
720  .type = AVMEDIA_TYPE_VIDEO,
721  .id = AV_CODEC_ID_H263P,
722  .priv_data_size = sizeof(MpegEncContext),
726  .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
728  .flush = ff_mpeg_flush,
729  .max_lowres = 3,
731 };