aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-25 14:36:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-25 14:36:45 +0100
commit25be63005f0ba0b4cb8bf2569202ad0e89b4dae3 (patch)
tree43bf6b49aa89942207f0937cfcab374524795a8f /libavcodec
parentb2d0c5bd13ab100a3acb18e9c869d73904e6e764 (diff)
parentb85a5e87af4254b80913fe33591d96361f30832b (diff)
downloadffmpeg-25be63005f0ba0b4cb8bf2569202ad0e89b4dae3.tar.gz
Merge commit 'b85a5e87af4254b80913fe33591d96361f30832b'
* commit 'b85a5e87af4254b80913fe33591d96361f30832b': lavu: Add av_strnstr() h264: Allow discarding the cropping information from SPS Conflicts: Changelog doc/APIchanges libavcodec/avcodec.h libavcodec/version.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h2
-rw-r--r--libavcodec/h264_ps.c14
-rw-r--r--libavcodec/options_table.h1
-rw-r--r--libavcodec/version.h2
4 files changed, 18 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c3b1b6ac6b..ca7764a8ba 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -713,6 +713,8 @@ typedef struct RcOverride{
#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. DEPRECATED!!!!
+#define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS.
+
#if FF_API_MPV_GLOBAL_OPTS
#define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.
#define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon.
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index a68645bc36..c7bacd9fa3 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -471,6 +471,20 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
sps->crop_right = get_ue_golomb(&s->gb);
sps->crop_top = get_ue_golomb(&s->gb);
sps->crop_bottom= get_ue_golomb(&s->gb);
+ if (h->s.avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) {
+ av_log(h->s.avctx, AV_LOG_DEBUG,
+ "discarding sps cropping, "
+ "original values are l:%u r:%u t:%u b:%u\n",
+ sps->crop_left,
+ sps->crop_right,
+ sps->crop_top,
+ sps->crop_bottom);
+
+ sps->crop_left =
+ sps->crop_right =
+ sps->crop_top =
+ sps->crop_bottom = 0;
+ }
if(sps->crop_left || sps->crop_top){
av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ... (left: %d, top: %d)\n", sps->crop_left, sps->crop_top);
}
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 764b5b1d88..33cb4b2f0c 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -79,6 +79,7 @@ static const AVOption options[]={
{"sgop", "Deprecated, use mpegvideo private options instead", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"},
#endif
{"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"},
+{"ignorecrop", "ignore cropping information from sps", 1, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"},
{"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"},
{"chunks", "Frame data might be split into multiple chunks", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_CHUNKS }, INT_MIN, INT_MAX, V|D, "flags2"},
{"showall", "Show all frames before the first keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, "flags2"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 0bc870936a..3f69494d82 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 54
-#define LIBAVCODEC_VERSION_MINOR 90
+#define LIBAVCODEC_VERSION_MINOR 91
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \