aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2023-12-11 01:17:18 +0100
committerClément Bœsch <u@pkh.me>2024-01-10 14:08:00 +0100
commitf06f2cf16a47d7fad60dd0fa30db6e99445ad89f (patch)
treed6cb8352a404c6c6e8feeef9b010e7182e8ef092
parent9f547e2f15174357a484c51024f9dd09c7c037cf (diff)
downloadffmpeg-f06f2cf16a47d7fad60dd0fa30db6e99445ad89f.tar.gz
avcodec/proresenc_anatoliy: move DC codebook LUT to shared proresdata
This is going to be shared with proresenc_kostya in the upcoming commit.
-rw-r--r--libavcodec/proresdata.c2
-rw-r--r--libavcodec/proresdata.h1
-rw-r--r--libavcodec/proresenc_anatoliy.c3
3 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/proresdata.c b/libavcodec/proresdata.c
index 167bedf794..00af97d4f1 100644
--- a/libavcodec/proresdata.c
+++ b/libavcodec/proresdata.c
@@ -44,6 +44,8 @@ const uint8_t ff_prores_interlaced_scan[64] = {
46, 39, 47, 54, 61, 62, 55, 63
};
+const uint8_t ff_prores_dc_codebook[7] = { 0x04, 0x28, 0x28, 0x4D, 0x4D, 0x70, 0x70 };
+
const uint8_t ff_prores_run_to_cb[16] = { 0x06, 0x06, 0x05, 0x05, 0x04, 0x29,
0x29, 0x29, 0x29, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x4C };
diff --git a/libavcodec/proresdata.h b/libavcodec/proresdata.h
index 28eb3256b6..d859e93e88 100644
--- a/libavcodec/proresdata.h
+++ b/libavcodec/proresdata.h
@@ -29,6 +29,7 @@
extern const uint8_t ff_prores_progressive_scan[64];
extern const uint8_t ff_prores_interlaced_scan[64];
+extern const uint8_t ff_prores_dc_codebook[7];
extern const uint8_t ff_prores_run_to_cb[16];
extern const uint8_t ff_prores_level_to_cb[10];
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 25768b6c08..88be49af3e 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -266,7 +266,6 @@ static av_always_inline int get_level(int val)
return (val ^ sign) - sign;
}
-static const uint8_t dc_codebook[7] = { 0x04, 0x28, 0x28, 0x4D, 0x4D, 0x70, 0x70};
static void encode_dc_coeffs(PutBitContext *pb, int16_t *in,
int blocks_per_slice, int *qmat)
@@ -286,7 +285,7 @@ static void encode_dc_coeffs(PutBitContext *pb, int16_t *in,
diff_sign = DIFF_SIGN(delta, sign);
new_code = TO_GOLOMB2(get_level(delta), diff_sign);
- encode_codeword(pb, new_code, dc_codebook[FFMIN(code, 6)]);
+ encode_codeword(pb, new_code, ff_prores_dc_codebook[FFMIN(code, 6)]);
code = new_code;
sign = delta >> 31;