aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/nuv.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2022-10-26 20:11:21 +1100
committerPeter Ross <pross@xvid.org>2022-10-26 20:30:25 +1100
commit58bd7d97a47da1065e2616d396938609b50ad1e4 (patch)
tree47b73bf18a25c15ed84eeb667f31fffa63a12497 /libavcodec/nuv.c
parent9bed814e1d44e8374e9a4901e3f9b00ded0716fb (diff)
downloadffmpeg-58bd7d97a47da1065e2616d396938609b50ad1e4.tar.gz
avcodec/jpegtables: remove duplicate luma and chroma quantization tables
Duplicates of the standard JPEG quantization tables were found in the AGM, MSS34(dsp), NUV and VP31 codecs. This patch elimates those duplicates, placing a single copy in jpegquanttables.c.
Diffstat (limited to 'libavcodec/nuv.c')
-rw-r--r--libavcodec/nuv.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index ccd47586b5..1d4f02217c 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -29,6 +29,7 @@
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
+#include "jpegquanttables.h"
#include "rtjpeg.h"
typedef struct NuvContext {
@@ -42,28 +43,6 @@ typedef struct NuvContext {
RTJpegContext rtj;
} NuvContext;
-static const uint8_t fallback_lquant[] = {
- 16, 11, 10, 16, 24, 40, 51, 61,
- 12, 12, 14, 19, 26, 58, 60, 55,
- 14, 13, 16, 24, 40, 57, 69, 56,
- 14, 17, 22, 29, 51, 87, 80, 62,
- 18, 22, 37, 56, 68, 109, 103, 77,
- 24, 35, 55, 64, 81, 104, 113, 92,
- 49, 64, 78, 87, 103, 121, 120, 101,
- 72, 92, 95, 98, 112, 100, 103, 99
-};
-
-static const uint8_t fallback_cquant[] = {
- 17, 18, 24, 47, 99, 99, 99, 99,
- 18, 21, 26, 66, 99, 99, 99, 99,
- 24, 26, 56, 99, 99, 99, 99, 99,
- 47, 66, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99
-};
-
/**
* @brief copy frame data from buffer to AVFrame, handling stride.
* @param f destination AVFrame
@@ -107,8 +86,8 @@ static void get_quant_quality(NuvContext *c, int quality)
int i;
quality = FFMAX(quality, 1);
for (i = 0; i < 64; i++) {
- c->lq[i] = (fallback_lquant[i] << 7) / quality;
- c->cq[i] = (fallback_cquant[i] << 7) / quality;
+ c->lq[i] = (ff_mjpeg_std_luminance_quant_tbl[i] << 7) / quality;
+ c->cq[i] = (ff_mjpeg_std_chrominance_quant_tbl[i] << 7) / quality;
}
}