History

h264: Allow discarding the cropping information from SPS

Some 3D systems overload the meaning of the field for other purposes.

Vittorio Giovara committed 13 years ago

Commit a84fb6e1 parent 33552a54 files · +18 −1Browse files

Unified · Split

4 files
  1. libavcodec/avcodec.h +2 −0
  2. libavcodec/h264_ps.c +14 −0
  3. libavcodec/options_table.h +1 −0
  4. libavcodec/version.h +1 −1
libavcodec/avcodec.h+2−0
@@ -657,6 +657,8 @@ typedef struct RcOverride{ · 656 unmodified lines
657#define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks.657#define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks.
658#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.658#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
659#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.659#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
660#define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS.
661
660#if FF_API_MPV_GLOBAL_OPTS662#if FF_API_MPV_GLOBAL_OPTS
661#define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.663#define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.
662#define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon.664#define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon.
libavcodec/h264_ps.c+14−0
@@ -425,6 +425,20 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){ · 424 unmodified lines
425 sps->crop_right = get_ue_golomb(&s->gb);425 sps->crop_right = get_ue_golomb(&s->gb);
426 sps->crop_top = get_ue_golomb(&s->gb);426 sps->crop_top = get_ue_golomb(&s->gb);
427 sps->crop_bottom= get_ue_golomb(&s->gb);427 sps->crop_bottom= get_ue_golomb(&s->gb);
428 if (h->s.avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
429 av_log(h->s.avctx, AV_LOG_DEBUG,
430 "discarding sps cropping, "
431 "original values are l:%u r:%u t:%u b:%u\n",
432 sps->crop_left,
433 sps->crop_right,
434 sps->crop_top,
435 sps->crop_bottom);
436
437 sps->crop_left =
438 sps->crop_right =
439 sps->crop_top =
440 sps->crop_bottom = 0;
441 }
428 if(sps->crop_left || sps->crop_top){442 if(sps->crop_left || sps->crop_top){
429 av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n");443 av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n");
430 }444 }
libavcodec/options_table.h+1−0
@@ -76,6 +76,7 @@ static const AVOption options[]={ · 75 unmodified lines
76{"sgop", "Deprecated, use mpegvideo private options instead", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"},76{"sgop", "Deprecated, use mpegvideo private options instead", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"},
77#endif77#endif
78{"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"},78{"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"},
79{"ignorecrop", "ignore cropping information from sps", 1, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"},
79{"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"},80{"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"},
80#if FF_API_SUB_ID81#if FF_API_SUB_ID
81{"sub_id", NULL, OFFSET(sub_id), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},82{"sub_id", NULL, OFFSET(sub_id), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
libavcodec/version.h+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
27 */27 */
28 28
29#define LIBAVCODEC_VERSION_MAJOR 5429#define LIBAVCODEC_VERSION_MAJOR 54
30#define LIBAVCODEC_VERSION_MINOR 4030#define LIBAVCODEC_VERSION_MINOR 41
31#define LIBAVCODEC_VERSION_MICRO 031#define LIBAVCODEC_VERSION_MICRO 0
32 32
33#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \33#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t