diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-01-19 00:00:48 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-01-28 01:09:38 +0100 |
commit | 5bcefceec8b648bc4c06c98ff7649ccdb140a0bb (patch) | |
tree | 511d9c50bef2a01d9362d6c93d8a6f9eccb25fb8 | |
parent | b860f2218a74723e5ad731888d513a3f68be6af0 (diff) | |
download | ffmpeg-5bcefceec8b648bc4c06c98ff7649ccdb140a0bb.tar.gz |
avcodec: Add discard_sample_percentage
Suggested-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | doc/APIchanges | 3 | ||||
-rw-r--r-- | libavcodec/avcodec.h | 8 | ||||
-rw-r--r-- | libavcodec/options_table.h | 1 | ||||
-rw-r--r-- | libavcodec/version.h | 2 | ||||
-rw-r--r-- | tests/ref/fate/api-mjpeg-codec-param | 2 | ||||
-rw-r--r-- | tests/ref/fate/api-png-codec-param | 2 |
6 files changed, 17 insertions, 1 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index a39a3ff2ba..784a5e5bd2 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2017-10-21 API changes, most recent first: +2019-01-27 - XXXXXXXXXX - lavc 58.46.100 - avcodec.h + Add discard_damaged_percentage + 2019-01-08 - xxxxxxxxxx - lavu 56.26.100 - frame.h Add AV_FRAME_DATA_REGIONS_OF_INTEREST diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 72dc277dfd..f554c53f0e 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3345,6 +3345,14 @@ typedef struct AVCodecContext { * used as reference pictures). */ int extra_hw_frames; + + /** + * The percentage of damaged samples to discard a frame. + * + * - decoding: set by user + * - encoding: unused + */ + int discard_damaged_percentage; } AVCodecContext; #if FF_API_CODEC_GET_SET diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index 2f36ec7b8e..a3235bcd57 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -479,6 +479,7 @@ static const AVOption avcodec_options[] = { {"allow_high_depth", "allow to output YUV pixel formats with a different chroma sampling than 4:2:0 and/or other than 8 bits per component", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH }, INT_MIN, INT_MAX, V | D, "hwaccel_flags"}, {"allow_profile_mismatch", "attempt to decode anyway if HW accelerated decoder's supported profiles do not exactly match the stream", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH }, INT_MIN, INT_MAX, V | D, "hwaccel_flags"}, {"extra_hw_frames", "Number of extra hardware frames to allocate for the user", OFFSET(extra_hw_frames), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, V|D }, +{"discard_damaged_percentage", "Percentage of damaged samples to discard a frame", OFFSET(discard_damaged_percentage), AV_OPT_TYPE_INT, {.i64 = 95 }, 0, 100, V|D }, {NULL}, }; diff --git a/libavcodec/version.h b/libavcodec/version.h index 5c9b688524..6a10536dcc 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -28,7 +28,7 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 58 -#define LIBAVCODEC_VERSION_MINOR 45 +#define LIBAVCODEC_VERSION_MINOR 46 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/tests/ref/fate/api-mjpeg-codec-param b/tests/ref/fate/api-mjpeg-codec-param index 0d2b55cff1..0815919d7d 100644 --- a/tests/ref/fate/api-mjpeg-codec-param +++ b/tests/ref/fate/api-mjpeg-codec-param @@ -138,6 +138,7 @@ stream=0, decode=0 max_pixels=2147483647 hwaccel_flags=0x00000001 extra_hw_frames=-1 + discard_damaged_percentage=95 stream=0, decode=1 b=0 ab=0 @@ -278,3 +279,4 @@ stream=0, decode=1 max_pixels=2147483647 hwaccel_flags=0x00000001 extra_hw_frames=-1 + discard_damaged_percentage=95 diff --git a/tests/ref/fate/api-png-codec-param b/tests/ref/fate/api-png-codec-param index 1ae94a2e91..a47d0963da 100644 --- a/tests/ref/fate/api-png-codec-param +++ b/tests/ref/fate/api-png-codec-param @@ -138,6 +138,7 @@ stream=0, decode=0 max_pixels=2147483647 hwaccel_flags=0x00000001 extra_hw_frames=-1 + discard_damaged_percentage=95 stream=0, decode=1 b=0 ab=0 @@ -278,3 +279,4 @@ stream=0, decode=1 max_pixels=2147483647 hwaccel_flags=0x00000001 extra_hw_frames=-1 + discard_damaged_percentage=95 |