aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/agm.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/agm.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/agm.c')
-rw-r--r--libavcodec/agm.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/libavcodec/agm.c b/libavcodec/agm.c
index 374e4f4ef2..b37f1a42c9 100644
--- a/libavcodec/agm.c
+++ b/libavcodec/agm.c
@@ -33,24 +33,7 @@
#include "decode.h"
#include "get_bits.h"
#include "idctdsp.h"
-
-static const uint8_t unscaled_luma[64] = {
- 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 unscaled_chroma[64] = {
- 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
-};
+#include "jpegquanttables.h"
typedef struct MotionVector {
int16_t x, y;
@@ -550,13 +533,13 @@ static void compute_quant_matrix(AGMContext *s, double qscale)
} else {
if (qscale >= 0.0) {
for (int i = 0; i < 64; i++) {
- luma[i] = FFMAX(1, unscaled_luma [(i & 7) * 8 + (i >> 3)] * f);
- chroma[i] = FFMAX(1, unscaled_chroma[(i & 7) * 8 + (i >> 3)] * f);
+ luma[i] = FFMAX(1, ff_mjpeg_std_luminance_quant_tbl [(i & 7) * 8 + (i >> 3)] * f);
+ chroma[i] = FFMAX(1, ff_mjpeg_std_chrominance_quant_tbl[(i & 7) * 8 + (i >> 3)] * f);
}
} else {
for (int i = 0; i < 64; i++) {
- luma[i] = FFMAX(1, 255.0 - (255 - unscaled_luma [(i & 7) * 8 + (i >> 3)]) * f);
- chroma[i] = FFMAX(1, 255.0 - (255 - unscaled_chroma[(i & 7) * 8 + (i >> 3)]) * f);
+ luma[i] = FFMAX(1, 255.0 - (255 - ff_mjpeg_std_luminance_quant_tbl [(i & 7) * 8 + (i >> 3)]) * f);
+ chroma[i] = FFMAX(1, 255.0 - (255 - ff_mjpeg_std_chrominance_quant_tbl[(i & 7) * 8 + (i >> 3)]) * f);
}
}
}