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