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  if (avctx->codec->id == AV_CODEC_ID_MSS2)
49  return AV_PIX_FMT_YUV420P;
50 
51  return avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
52 }
53 
55 {
56  MpegEncContext *s = avctx->priv_data;
57  int ret;
58 
59  s->out_format = FMT_H263;
60 
61  // set defaults
63  ff_mpv_decode_init(s, avctx);
64 
65  s->quant_precision = 5;
67  s->low_delay = 1;
68  s->unrestricted_mv = 1;
69 
70  /* select sub codec */
71  switch (avctx->codec->id) {
72  case AV_CODEC_ID_H263:
73  case AV_CODEC_ID_H263P:
74  s->unrestricted_mv = 0;
76  break;
77  case AV_CODEC_ID_MPEG4:
78  break;
80  s->h263_pred = 1;
81  s->msmpeg4_version = 1;
82  break;
84  s->h263_pred = 1;
85  s->msmpeg4_version = 2;
86  break;
88  s->h263_pred = 1;
89  s->msmpeg4_version = 3;
90  break;
91  case AV_CODEC_ID_WMV1:
92  s->h263_pred = 1;
93  s->msmpeg4_version = 4;
94  break;
95  case AV_CODEC_ID_WMV2:
96  s->h263_pred = 1;
97  s->msmpeg4_version = 5;
98  break;
99  case AV_CODEC_ID_VC1:
100  case AV_CODEC_ID_WMV3:
103  case AV_CODEC_ID_MSS2:
104  s->h263_pred = 1;
105  s->msmpeg4_version = 6;
107  break;
108  case AV_CODEC_ID_H263I:
109  break;
110  case AV_CODEC_ID_FLV1:
111  s->h263_flv = 1;
112  break;
113  default:
114  av_log(avctx, AV_LOG_ERROR, "Unsupported codec %d\n",
115  avctx->codec->id);
116  return AVERROR(ENOSYS);
117  }
118  s->codec_id = avctx->codec->id;
119 
120  if (avctx->stream_codec_tag == AV_RL32("l263") && avctx->extradata_size == 56 && avctx->extradata[0] == 1)
121  s->ehc_mode = 1;
122 
123  /* for h263, we allocate the images after having read the header */
124  if (avctx->codec->id != AV_CODEC_ID_H263 &&
125  avctx->codec->id != AV_CODEC_ID_H263P &&
126  avctx->codec->id != AV_CODEC_ID_MPEG4) {
127  avctx->pix_fmt = h263_get_format(avctx);
128  ff_mpv_idct_init(s);
129  if ((ret = ff_mpv_common_init(s)) < 0)
130  return ret;
131  }
132 
134  ff_qpeldsp_init(&s->qdsp);
136 
137  return 0;
138 }
139 
141 {
142  MpegEncContext *s = avctx->priv_data;
143 
145  return 0;
146 }
147 
148 /**
149  * Return the number of bytes consumed for building the current frame.
150  */
151 static int get_consumed_bytes(MpegEncContext *s, int buf_size)
152 {
153  int pos = (get_bits_count(&s->gb) + 7) >> 3;
154 
155  if (s->divx_packed || s->avctx->hwaccel) {
156  /* We would have to scan through the whole buf to handle the weird
157  * reordering ... */
158  return buf_size;
159  } else if (s->flags & CODEC_FLAG_TRUNCATED) {
160  pos -= s->parse_context.last_index;
161  // padding is not really read so this might be -1
162  if (pos < 0)
163  pos = 0;
164  return pos;
165  } else {
166  // avoid infinite loops (maybe not needed...)
167  if (pos == 0)
168  pos = 1;
169  // oops ;)
170  if (pos + 10 > buf_size)
171  pos = buf_size;
172 
173  return pos;
174  }
175 }
176 
178 {
179  const int part_mask = s->partitioned_frame
180  ? (ER_AC_END | ER_AC_ERROR) : 0x7F;
181  const int mb_size = 16 >> s->avctx->lowres;
182  int ret;
183 
184  s->last_resync_gb = s->gb;
185  s->first_slice_line = 1;
186  s->resync_mb_x = s->mb_x;
187  s->resync_mb_y = s->mb_y;
188 
189  ff_set_qscale(s, s->qscale);
190 
191  if (s->avctx->hwaccel) {
192  const uint8_t *start = s->gb.buffer + get_bits_count(&s->gb) / 8;
193  ret = s->avctx->hwaccel->decode_slice(s->avctx, start, s->gb.buffer_end - start);
194  // ensure we exit decode loop
195  s->mb_y = s->mb_height;
196  return ret;
197  }
198 
199  if (s->partitioned_frame) {
200  const int qscale = s->qscale;
201 
202  if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4)
203  if ((ret = ff_mpeg4_decode_partitions(s->avctx->priv_data)) < 0)
204  return ret;
205 
206  /* restore variables which were modified */
207  s->first_slice_line = 1;
208  s->mb_x = s->resync_mb_x;
209  s->mb_y = s->resync_mb_y;
210  ff_set_qscale(s, qscale);
211  }
212 
213  for (; s->mb_y < s->mb_height; s->mb_y++) {
214  /* per-row end of slice checks */
215  if (s->msmpeg4_version) {
216  if (s->resync_mb_y + s->slice_height == s->mb_y) {
218  s->mb_x - 1, s->mb_y, ER_MB_END);
219 
220  return 0;
221  }
222  }
223 
224  if (s->msmpeg4_version == 1) {
225  s->last_dc[0] =
226  s->last_dc[1] =
227  s->last_dc[2] = 128;
228  }
229 
231  for (; s->mb_x < s->mb_width; s->mb_x++) {
232  int ret;
233 
235 
236  if (s->resync_mb_x == s->mb_x && s->resync_mb_y + 1 == s->mb_y)
237  s->first_slice_line = 0;
238 
239  /* DCT & quantize */
240 
241  s->mv_dir = MV_DIR_FORWARD;
242  s->mv_type = MV_TYPE_16X16;
243  av_dlog(s, "%d %d %06X\n",
244  ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
245 
246  tprintf(NULL, "Decoding MB at %dx%d\n", s->mb_x, s->mb_y);
247  ret = s->decode_mb(s, s->block);
248 
249  if (s->pict_type != AV_PICTURE_TYPE_B)
251 
252  if (ret < 0) {
253  const int xy = s->mb_x + s->mb_y * s->mb_stride;
254  if (ret == SLICE_END) {
255  ff_mpv_decode_mb(s, s->block);
256  if (s->loop_filter)
258 
260  s->mb_x, s->mb_y, ER_MB_END & part_mask);
261 
262  s->padding_bug_score--;
263 
264  if (++s->mb_x >= s->mb_width) {
265  s->mb_x = 0;
266  ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
268  s->mb_y++;
269  }
270  return 0;
271  } else if (ret == SLICE_NOEND) {
273  "Slice mismatch at MB: %d\n", xy);
275  s->mb_x + 1, s->mb_y,
276  ER_MB_END & part_mask);
277  return AVERROR_INVALIDDATA;
278  }
279  av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n", xy);
281  s->mb_x, s->mb_y, ER_MB_ERROR & part_mask);
282 
284  continue;
285  return AVERROR_INVALIDDATA;
286  }
287 
288  ff_mpv_decode_mb(s, s->block);
289  if (s->loop_filter)
291  }
292 
293  ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
295 
296  s->mb_x = 0;
297  }
298 
299  av_assert1(s->mb_x == 0 && s->mb_y == s->mb_height);
300 
301  if (s->codec_id == AV_CODEC_ID_MPEG4 &&
303  get_bits_left(&s->gb) >= 48 &&
304  show_bits(&s->gb, 24) == 0x4010 &&
305  !s->data_partitioning)
306  s->padding_bug_score += 32;
307 
308  /* try to detect the padding bug */
309  if (s->codec_id == AV_CODEC_ID_MPEG4 &&
311  get_bits_left(&s->gb) >= 0 &&
312  get_bits_left(&s->gb) < 137 &&
313  !s->data_partitioning) {
314  const int bits_count = get_bits_count(&s->gb);
315  const int bits_left = s->gb.size_in_bits - bits_count;
316 
317  if (bits_left == 0) {
318  s->padding_bug_score += 16;
319  } else if (bits_left != 1) {
320  int v = show_bits(&s->gb, 8);
321  v |= 0x7F >> (7 - (bits_count & 7));
322 
323  if (v == 0x7F && bits_left <= 8)
324  s->padding_bug_score--;
325  else if (v == 0x7F && ((get_bits_count(&s->gb) + 8) & 8) &&
326  bits_left <= 16)
327  s->padding_bug_score += 4;
328  else
329  s->padding_bug_score++;
330  }
331  }
332 
333  if (s->codec_id == AV_CODEC_ID_H263 &&
335  get_bits_left(&s->gb) >= 8 &&
336  get_bits_left(&s->gb) < 300 &&
338  show_bits(&s->gb, 8) == 0 &&
339  !s->data_partitioning) {
340 
341  s->padding_bug_score += 32;
342  }
343 
344  if (s->codec_id == AV_CODEC_ID_H263 &&
346  get_bits_left(&s->gb) >= 64 &&
347  AV_RB64(s->gb.buffer_end - 8) == 0xCDCDCDCDFC7F0000) {
348 
349  s->padding_bug_score += 32;
350  }
351 
353  if (
354  (s->padding_bug_score > -2 && !s->data_partitioning))
356  else
358  }
359 
360  // handle formats which don't have unique end markers
361  if (s->msmpeg4_version || (s->workaround_bugs & FF_BUG_NO_PADDING)) { // FIXME perhaps solve this more cleanly
362  int left = get_bits_left(&s->gb);
363  int max_extra = 7;
364 
365  /* no markers in M$ crap */
367  max_extra += 17;
368 
369  /* buggy padding but the frame should still end approximately at
370  * the bitstream end */
371  if ((s->workaround_bugs & FF_BUG_NO_PADDING) &&
373  max_extra += 48;
374  else if ((s->workaround_bugs & FF_BUG_NO_PADDING))
375  max_extra += 256 * 256 * 256 * 64;
376 
377  if (left > max_extra)
379  "discarding %d junk bits at end, next would be %X\n",
380  left, show_bits(&s->gb, 24));
381  else if (left < 0)
382  av_log(s->avctx, AV_LOG_ERROR, "overreading %d bits\n", -left);
383  else
385  s->mb_x - 1, s->mb_y, ER_MB_END);
386 
387  return 0;
388  }
389 
391  "slice end not reached but screenspace end (%d left %06X, score= %d)\n",
392  get_bits_left(&s->gb), show_bits(&s->gb, 24), s->padding_bug_score);
393 
394  ff_er_add_slice(&s->er, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y,
395  ER_MB_END & part_mask);
396 
397  return AVERROR_INVALIDDATA;
398 }
399 
400 int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
401  AVPacket *avpkt)
402 {
403  const uint8_t *buf = avpkt->data;
404  int buf_size = avpkt->size;
405  MpegEncContext *s = avctx->priv_data;
406  int ret;
407  int slice_ret = 0;
408  AVFrame *pict = data;
409 
410  s->flags = avctx->flags;
411  s->flags2 = avctx->flags2;
412 
413  /* no supplementary picture */
414  if (buf_size == 0) {
415  /* special case for last picture */
416  if (s->low_delay == 0 && s->next_picture_ptr) {
417  if ((ret = av_frame_ref(pict, s->next_picture_ptr->f)) < 0)
418  return ret;
419  s->next_picture_ptr = NULL;
420 
421  *got_frame = 1;
422  }
423 
424  return 0;
425  }
426 
427  if (s->flags & CODEC_FLAG_TRUNCATED) {
428  int next;
429 
430  if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4) {
431  next = ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size);
432  } else if (CONFIG_H263_DECODER && s->codec_id == AV_CODEC_ID_H263) {
433  next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size);
434  } else if (CONFIG_H263P_DECODER && s->codec_id == AV_CODEC_ID_H263P) {
435  next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size);
436  } else {
438  "this codec does not support truncated bitstreams\n");
439  return AVERROR(ENOSYS);
440  }
441 
442  if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf,
443  &buf_size) < 0)
444  return buf_size;
445  }
446 
447 retry:
448  if (s->divx_packed && s->bitstream_buffer_size) {
449  int i;
450  for(i=0; i < buf_size-3; i++) {
451  if (buf[i]==0 && buf[i+1]==0 && buf[i+2]==1) {
452  if (buf[i+3]==0xB0) {
453  av_log(s->avctx, AV_LOG_WARNING, "Discarding excessive bitstream in packed xvid\n");
454  s->bitstream_buffer_size = 0;
455  }
456  break;
457  }
458  }
459  }
460 
461  if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) // divx 5.01+/xvid frame reorder
462  ret = init_get_bits8(&s->gb, s->bitstream_buffer,
464  else
465  ret = init_get_bits8(&s->gb, buf, buf_size);
466 
467  s->bitstream_buffer_size = 0;
468  if (ret < 0)
469  return ret;
470 
471  if (!s->context_initialized)
472  // we need the idct permutaton for reading a custom matrix
473  ff_mpv_idct_init(s);
474 
475  /* let's go :-) */
476  if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) {
478  } else if (CONFIG_MSMPEG4_DECODER && s->msmpeg4_version) {
480  } else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) {
481  if (s->avctx->extradata_size && s->picture_number == 0) {
482  GetBitContext gb;
483 
484  if (init_get_bits8(&gb, s->avctx->extradata, s->avctx->extradata_size) >= 0 )
486  }
487  ret = ff_mpeg4_decode_picture_header(avctx->priv_data, &s->gb);
488  } else if (CONFIG_H263I_DECODER && s->codec_id == AV_CODEC_ID_H263I) {
490  } else if (CONFIG_FLV_DECODER && s->h263_flv) {
492  } else {
494  }
495 
496  if (ret < 0 || ret == FRAME_SKIPPED) {
497  if ( s->width != avctx->coded_width
498  || s->height != avctx->coded_height) {
499  av_log(s->avctx, AV_LOG_WARNING, "Reverting picture dimensions change due to header decoding failure\n");
500  s->width = avctx->coded_width;
501  s->height= avctx->coded_height;
502  }
503  }
504  if (ret == FRAME_SKIPPED)
505  return get_consumed_bytes(s, buf_size);
506 
507  /* skip if the header was thrashed */
508  if (ret < 0) {
509  av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
510  return ret;
511  }
512 
513  if (!s->context_initialized) {
514  avctx->pix_fmt = h263_get_format(avctx);
515  if ((ret = ff_mpv_common_init(s)) < 0)
516  return ret;
517  }
518 
519  if (!s->current_picture_ptr || s->current_picture_ptr->f->data[0]) {
520  int i = ff_find_unused_picture(s, 0);
521  if (i < 0)
522  return i;
523  s->current_picture_ptr = &s->picture[i];
524  }
525 
526  avctx->has_b_frames = !s->low_delay;
527 
528  if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) {
529  if (ff_mpeg4_workaround_bugs(avctx) == 1)
530  goto retry;
531  }
532 
533  /* After H263 & mpeg4 header decode we have the height, width,
534  * and other parameters. So then we could init the picture.
535  * FIXME: By the way H263 decoder is evolving it should have
536  * an H263EncContext */
537  if (s->width != avctx->coded_width ||
538  s->height != avctx->coded_height ||
539  s->context_reinit) {
540  /* H.263 could change picture size any time */
541  s->context_reinit = 0;
542 
543  ret = ff_set_dimensions(avctx, s->width, s->height);
544  if (ret < 0)
545  return ret;
546 
547  ff_set_sar(avctx, avctx->sample_aspect_ratio);
548 
549  if ((ret = ff_mpv_common_frame_size_change(s)))
550  return ret;
551 
552  if (avctx->pix_fmt != h263_get_format(avctx)) {
553  av_log(avctx, AV_LOG_ERROR, "format change not supported\n");
554  avctx->pix_fmt = AV_PIX_FMT_NONE;
555  return AVERROR_UNKNOWN;
556  }
557  }
558 
559  if (s->codec_id == AV_CODEC_ID_H263 ||
560  s->codec_id == AV_CODEC_ID_H263P ||
563 
564  // for skipping the frame
567 
568  /* skip B-frames if we don't have reference frames */
569  if (!s->last_picture_ptr &&
570  (s->pict_type == AV_PICTURE_TYPE_B || s->droppable))
571  return get_consumed_bytes(s, buf_size);
572  if ((avctx->skip_frame >= AVDISCARD_NONREF &&
573  s->pict_type == AV_PICTURE_TYPE_B) ||
574  (avctx->skip_frame >= AVDISCARD_NONKEY &&
575  s->pict_type != AV_PICTURE_TYPE_I) ||
576  avctx->skip_frame >= AVDISCARD_ALL)
577  return get_consumed_bytes(s, buf_size);
578 
579  if (s->next_p_frame_damaged) {
580  if (s->pict_type == AV_PICTURE_TYPE_B)
581  return get_consumed_bytes(s, buf_size);
582  else
583  s->next_p_frame_damaged = 0;
584  }
585 
586  if ((!s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) {
589  } else {
592  }
593 
594  if ((ret = ff_mpv_frame_start(s, avctx)) < 0)
595  return ret;
596 
597  if (!s->divx_packed && !avctx->hwaccel)
598  ff_thread_finish_setup(avctx);
599 
600  if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) {
602  goto frame_end;
603  }
604 
605  if (avctx->hwaccel) {
606  ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer,
607  s->gb.buffer_end - s->gb.buffer);
608  if (ret < 0 )
609  return ret;
610  }
611 
613 
614  /* the second part of the wmv2 header contains the MB skip bits which
615  * are stored in current_picture->mb_type which is not available before
616  * ff_mpv_frame_start() */
617  if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) {
619  if (ret < 0)
620  return ret;
621  if (ret == 1)
622  goto frame_end;
623  }
624 
625  /* decode each macroblock */
626  s->mb_x = 0;
627  s->mb_y = 0;
628 
629  slice_ret = decode_slice(s);
630  while (s->mb_y < s->mb_height) {
631  if (s->msmpeg4_version) {
632  if (s->slice_height == 0 || s->mb_x != 0 ||
633  (s->mb_y % s->slice_height) != 0 || get_bits_left(&s->gb) < 0)
634  break;
635  } else {
636  int prev_x = s->mb_x, prev_y = s->mb_y;
637  if (ff_h263_resync(s) < 0)
638  break;
639  if (prev_y * s->mb_width + prev_x < s->mb_y * s->mb_width + s->mb_x)
640  s->er.error_occurred = 1;
641  }
642 
643  if (s->msmpeg4_version < 4 && s->h263_pred)
645 
646  if (decode_slice(s) < 0)
647  slice_ret = AVERROR_INVALIDDATA;
648  }
649 
650  if (s->msmpeg4_version && s->msmpeg4_version < 4 &&
652  if (!CONFIG_MSMPEG4_DECODER ||
653  ff_msmpeg4_decode_ext_header(s, buf_size) < 0)
655 
657 frame_end:
658  ff_er_frame_end(&s->er);
659 
660  if (avctx->hwaccel) {
661  ret = avctx->hwaccel->end_frame(avctx);
662  if (ret < 0)
663  return ret;
664  }
665 
666  ff_mpv_frame_end(s);
667 
668  if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4)
669  ff_mpeg4_frame_end(avctx, buf, buf_size);
670 
671  if (!s->divx_packed && avctx->hwaccel)
672  ff_thread_finish_setup(avctx);
673 
676  if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
677  if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
678  return ret;
681  } else if (s->last_picture_ptr) {
682  if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
683  return ret;
686  }
687 
688  if (s->last_picture_ptr || s->low_delay) {
689  if ( pict->format == AV_PIX_FMT_YUV420P
690  && (s->codec_tag == AV_RL32("GEOV") || s->codec_tag == AV_RL32("GEOX"))) {
691  int x, y, p;
693  for (p=0; p<3; p++) {
694  int w = FF_CEIL_RSHIFT(pict-> width, !!p);
695  int h = FF_CEIL_RSHIFT(pict->height, !!p);
696  int linesize = pict->linesize[p];
697  for (y=0; y<(h>>1); y++)
698  for (x=0; x<w; x++)
699  FFSWAP(int,
700  pict->data[p][x + y*linesize],
701  pict->data[p][x + (h-1-y)*linesize]);
702  }
703  }
704  *got_frame = 1;
705  }
706 
707  if (slice_ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
708  return ret;
709  else
710  return get_consumed_bytes(s, buf_size);
711 }
712 
714 #if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL
716 #endif
717 #if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL
719 #endif
722 };
723 
725  .name = "h263",
726  .long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"),
727  .type = AVMEDIA_TYPE_VIDEO,
728  .id = AV_CODEC_ID_H263,
729  .priv_data_size = sizeof(MpegEncContext),
733  .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
735  .flush = ff_mpeg_flush,
736  .max_lowres = 3,
738 };
739 
741  .name = "h263p",
742  .long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"),
743  .type = AVMEDIA_TYPE_VIDEO,
744  .id = AV_CODEC_ID_H263P,
745  .priv_data_size = sizeof(MpegEncContext),
749  .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
751  .flush = ff_mpeg_flush,
752  .max_lowres = 3,
754 };