[FFmpeg-devel] [PATCH 1/2] tools/target_dec_fuzzer: Sort threshold list alphabetically

Michael Niedermayer michael at niedermayer.cc
Sun Jan 26 01:56:25 EET 2020


This also removes the comments as they are hard to maintain
together with sorted lists

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 tools/target_dec_fuzzer.c | 54 ++++++++++++++++++---------------------
 1 file changed, 25 insertions(+), 29 deletions(-)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index a3d784a019..79d8dab1b9 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -136,36 +136,32 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     maxpixels = maxpixels_per_frame * maxiteration;
     maxsamples = maxsamples_per_frame * maxiteration;
     switch (c->id) {
-        // Allows a small input to generate gigantic output
-    case AV_CODEC_ID_BINKVIDEO: maxpixels /= 32; break;
-    case AV_CODEC_ID_CFHD:      maxpixels /= 128; break;
-    case AV_CODEC_ID_DIRAC:     maxpixels /= 8192; break;
-    case AV_CODEC_ID_DST:       maxsamples /= 8192; break;
-    case AV_CODEC_ID_DXV:       maxpixels /= 32;  break;
+    case AV_CODEC_ID_BINKVIDEO:   maxpixels  /= 32;    break;
+    case AV_CODEC_ID_CFHD:        maxpixels  /= 128;   break;
+    case AV_CODEC_ID_DIRAC:       maxpixels  /= 8192;  break;
+    case AV_CODEC_ID_DST:         maxsamples /= 8192;  break;
+    case AV_CODEC_ID_DXV:         maxpixels  /= 32;    break;
     case AV_CODEC_ID_FFWAVESYNTH: maxsamples /= 16384; break;
-    case AV_CODEC_ID_MSRLE:     maxpixels /= 16;  break;
-    case AV_CODEC_ID_QTRLE:     maxpixels /= 16;  break;
-    case AV_CODEC_ID_RASC:      maxpixels /= 16;  break;
-    case AV_CODEC_ID_SANM:      maxpixels /= 16;  break;
-    case AV_CODEC_ID_G2M:       maxpixels /= 64;  break;
-    case AV_CODEC_ID_GIF:       maxpixels /= 16;  break;
-        // Performs slow frame rescaling in C
-    case AV_CODEC_ID_GDV:       maxpixels /= 512; break;
-        // Postprocessing in C
-    case AV_CODEC_ID_HNM4_VIDEO:maxpixels /= 128; break;
-        // Cliping in C, generally slow even with small input
-    case AV_CODEC_ID_INDEO4:    maxpixels /= 128; break;
-    case AV_CODEC_ID_LSCR:        maxpixels /= 16; break;
-    case AV_CODEC_ID_MOTIONPIXELS:maxpixels /= 256; break;
-    case AV_CODEC_ID_MSS2:        maxpixels /= 16384; break;
-    case AV_CODEC_ID_MSZH:        maxpixels /= 128; break;
-    case AV_CODEC_ID_SCPR:        maxpixels /= 32;    break;
-    case AV_CODEC_ID_SMACKVIDEO:  maxpixels /= 64; break;
-    case AV_CODEC_ID_SNOW:        maxpixels /= 128; break;
-    case AV_CODEC_ID_TGV:         maxpixels /= 32;    break;
-    case AV_CODEC_ID_TRUEMOTION2: maxpixels /= 1024; break;
-    case AV_CODEC_ID_VP7:         maxpixels /= 256;  break;
-    case AV_CODEC_ID_VP9:         maxpixels /= 4096; break;
+    case AV_CODEC_ID_G2M:         maxpixels  /= 64;    break;
+    case AV_CODEC_ID_GDV:         maxpixels  /= 512;   break;
+    case AV_CODEC_ID_GIF:         maxpixels  /= 16;    break;
+    case AV_CODEC_ID_HNM4_VIDEO:  maxpixels  /= 128;   break;
+    case AV_CODEC_ID_INDEO4:      maxpixels  /= 128;   break;
+    case AV_CODEC_ID_LSCR:        maxpixels  /= 16;    break;
+    case AV_CODEC_ID_MOTIONPIXELS:maxpixels  /= 256;   break;
+    case AV_CODEC_ID_MSRLE:       maxpixels  /= 16;    break;
+    case AV_CODEC_ID_MSS2:        maxpixels  /= 16384; break;
+    case AV_CODEC_ID_MSZH:        maxpixels  /= 128;   break;
+    case AV_CODEC_ID_QTRLE:       maxpixels  /= 16;    break;
+    case AV_CODEC_ID_RASC:        maxpixels  /= 16;    break;
+    case AV_CODEC_ID_SANM:        maxpixels  /= 16;    break;
+    case AV_CODEC_ID_SCPR:        maxpixels  /= 32;    break;
+    case AV_CODEC_ID_SMACKVIDEO:  maxpixels  /= 64;    break;
+    case AV_CODEC_ID_SNOW:        maxpixels  /= 128;   break;
+    case AV_CODEC_ID_TGV:         maxpixels  /= 32;    break;
+    case AV_CODEC_ID_TRUEMOTION2: maxpixels  /= 1024;  break;
+    case AV_CODEC_ID_VP7:         maxpixels  /= 256;   break;
+    case AV_CODEC_ID_VP9:         maxpixels  /= 4096;  break;
     }
 
 
-- 
2.25.0



More information about the ffmpeg-devel mailing list