]> git.sesse.net Git - ffmpeg/commitdiff
avcodec: Add discard_sample_percentage
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 18 Jan 2019 23:00:48 +0000 (00:00 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 28 Jan 2019 00:09:38 +0000 (01:09 +0100)
Suggested-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
doc/APIchanges
libavcodec/avcodec.h
libavcodec/options_table.h
libavcodec/version.h
tests/ref/fate/api-mjpeg-codec-param
tests/ref/fate/api-png-codec-param

index a39a3ff2ba07cd57e4ee2f7579dcea4c3c8df1f6..784a5e5bd237311b04fa696c75c8d22fa27c1586 100644 (file)
@@ -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
 
index 72dc277dfdbb53aead4d23ffd5af0964eb86b124..f554c53f0e7964e6d3b78b3779febf80533dae2a 100644 (file)
@@ -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
index 2f36ec7b8e6446922c025debca4c608a1f36df29..a3235bcd57b993f21db2601a3d8eb96fdc2a0e2f 100644 (file)
@@ -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},
 };
 
index 5c9b688524dfbc9fadaad8cf6efe3e1b87f150e0..6a10536dcc295b61c0e33b20005d06e3bc9185d6 100644 (file)
@@ -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, \
index 0d2b55cff196410fe8c5add961758ba58052370e..0815919d7d96db3945675349309fb9feea3efb5c 100644 (file)
@@ -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
index 1ae94a2e9123a73f696109981147902ce0e2ab7a..a47d0963da0265354910c4d02bd7fcd9d9d8f1dc 100644 (file)
@@ -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