* [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec
@ 2022-10-30 23:41 Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 02/19] avcodec/vc1: Remove always-false check Andreas Rheinhardt
` (23 more replies)
0 siblings, 24 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:41 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
This check has been added in c617bed34f39a122ab1f89581ddce9cc63885383,
merging ee769c6a7c1d4ec6560f5e5a6f457b770b10fb33 to fix
a possible segfault if AVCodecContext.codec is not set
as it may be during parsing. While this fixes the segfault,
it has the unfortunate side effect that it makes the output
of the parser dependent on whether a decoder is set (and
ultimately available). The fix later applied in
5d2be71b9ecf2a88752666a2c4039f4d98419d35 does not have this
downside and makes checking AVCodecContext.codec superfluous.
So remove this check.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index c9257b290f..f6de8b9e75 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -632,8 +632,6 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
v->fcm = PROGRESSIVE;
if (v->finterpflag)
v->interpfrm = get_bits1(gb);
- if (!v->s.avctx->codec)
- return -1;
if (v->s.avctx->codec_id == AV_CODEC_ID_MSS2)
v->respic =
v->rangered =
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 02/19] avcodec/vc1: Remove always-false check
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 03/19] avcodec/vc1: Don't check for errors for complete VLC Andreas Rheinhardt
` (22 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Added in b50be4e38dc83389925dc14f24fa11e660d32197;
this check was racy back then (as the VLC could be initialized
concurrently) and it is redundant (always-false)
since commit c742ab4e81bb9dcabfdab006d6b8b09a5808c4ce.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index f6de8b9e75..cacb66b15b 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -933,8 +933,6 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
v->rnd = get_bits1(gb);
if (v->interlace)
v->uvsamp = get_bits1(gb);
- if(!ff_vc1_bfraction_vlc.table)
- return 0; //parsing only, vlc tables havnt been allocated
if (v->field_mode) {
if (!v->refdist_flag)
v->refdist = 0;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 03/19] avcodec/vc1: Don't check for errors for complete VLC
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 02/19] avcodec/vc1: Remove always-false check Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 04/19] avcodec/vc1: Don't use VLC to read bfraction Andreas Rheinhardt
` (21 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index cacb66b15b..9b4e951baa 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -615,7 +615,7 @@ static void rotate_luts(VC1Context *v)
static int read_bfraction(VC1Context *v, GetBitContext* gb) {
int bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
- if (bfraction_lut_index == 21 || bfraction_lut_index < 0) {
+ if (bfraction_lut_index == 21) {
av_log(v->s.avctx, AV_LOG_ERROR, "bfraction invalid\n");
return AVERROR_INVALIDDATA;
}
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 04/19] avcodec/vc1: Don't use VLC to read bfraction
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 02/19] avcodec/vc1: Remove always-false check Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 03/19] avcodec/vc1: Don't check for errors for complete VLC Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 05/19] avcodec/vc1_parser: Set parse_only only once Andreas Rheinhardt
` (20 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The VLC here is very simple, so that it can just be read
by two get_bits().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1.c | 8 ++++----
libavcodec/vc1data.c | 21 ---------------------
libavcodec/vc1data.h | 4 ----
3 files changed, 4 insertions(+), 29 deletions(-)
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 9b4e951baa..f6468b54c7 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -613,7 +613,10 @@ static void rotate_luts(VC1Context *v)
}
static int read_bfraction(VC1Context *v, GetBitContext* gb) {
- int bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
+ int bfraction_lut_index = get_bits(gb, 3);
+
+ if (bfraction_lut_index == 7)
+ bfraction_lut_index = 7 + get_bits(gb, 4);
if (bfraction_lut_index == 21) {
av_log(v->s.avctx, AV_LOG_ERROR, "bfraction invalid\n");
@@ -1582,9 +1585,6 @@ static av_cold void vc1_init_static(void)
{
static VLCElem vlc_table[32372];
- INIT_VLC_STATIC(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23,
- ff_vc1_bfraction_bits, 1, 1,
- ff_vc1_bfraction_codes, 1, 1, 1 << VC1_BFRACTION_VLC_BITS);
INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
ff_vc1_norm2_bits, 1, 1,
ff_vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS);
diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c
index 844bc0f5c5..01a9767d51 100644
--- a/libavcodec/vc1data.c
+++ b/libavcodec/vc1data.c
@@ -102,8 +102,6 @@ const uint8_t ff_vc1_pquant_table[3][32] = {
* @todo TODO move this into the context
*/
//@{
-#define VC1_BFRACTION_VLC_BITS 7
-VLC ff_vc1_bfraction_vlc;
#define VC1_IMODE_VLC_BITS 4
VLC ff_vc1_imode_vlc;
#define VC1_NORM2_VLC_BITS 3
@@ -171,25 +169,6 @@ const int16_t ff_vc1_bfraction_lut[23] = {
};
#endif
-const uint8_t ff_vc1_bfraction_bits[23] = {
- 3, 3, 3, 3,
- 3, 3, 3,
- 7, 7, 7, 7,
- 7, 7, 7, 7,
- 7, 7, 7, 7,
- 7, 7,
- 7, 7
-};
-const uint8_t ff_vc1_bfraction_codes[23] = {
- 0, 1, 2, 3,
- 4, 5, 6,
- 112, 113, 114, 115,
- 116, 117, 118, 119,
- 120, 121, 122, 123,
- 124, 125,
- 126, 127
-};
-
//Same as H.264
const AVRational ff_vc1_pixel_aspect[16] = {
{ 0, 1 },
diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h
index 90dd8baf61..3e45ef1e79 100644
--- a/libavcodec/vc1data.h
+++ b/libavcodec/vc1data.h
@@ -53,8 +53,6 @@ extern const uint8_t ff_vc1_mbmode_intfrp[2][15][4];
* @todo TODO move this into the context
*/
//@{
-#define VC1_BFRACTION_VLC_BITS 7
-extern VLC ff_vc1_bfraction_vlc;
#define VC1_IMODE_VLC_BITS 4
extern VLC ff_vc1_imode_vlc;
#define VC1_NORM2_VLC_BITS 3
@@ -100,8 +98,6 @@ extern VLC ff_vc1_ac_coeff_table[8];
/* pre-computed scales for all bfractions and base=256 */
extern const int16_t ff_vc1_bfraction_lut[23];
-extern const uint8_t ff_vc1_bfraction_bits[23];
-extern const uint8_t ff_vc1_bfraction_codes[23];
//Same as H.264
extern const AVRational ff_vc1_pixel_aspect[16];
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 05/19] avcodec/vc1_parser: Set parse_only only once
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (2 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 04/19] avcodec/vc1: Don't use VLC to read bfraction Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 06/19] avcodec/vc1_parser: Don't call ff_vc1_init_common() Andreas Rheinhardt
` (19 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1_parser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c
index 8257e0ccfa..d57fcdf1e1 100644
--- a/libavcodec/vc1_parser.c
+++ b/libavcodec/vc1_parser.c
@@ -65,7 +65,6 @@ static void vc1_extract_header(AVCodecParserContext *s, AVCodecContext *avctx,
GetBitContext gb;
int ret;
vpc->v.s.avctx = avctx;
- vpc->v.parse_only = 1;
init_get_bits8(&gb, buf, buf_size);
switch (vpc->prev_start_code) {
case VC1_CODE_SEQHDR & 0xFF:
@@ -260,6 +259,7 @@ static av_cold int vc1_parse_init(AVCodecParserContext *s)
VC1ParseContext *vpc = s->priv_data;
vpc->v.s.slice_context_count = 1;
vpc->v.first_pic_header_flag = 1;
+ vpc->v.parse_only = 1;
vpc->prev_start_code = 0;
vpc->bytes_to_skip = 0;
vpc->unesc_index = 0;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 06/19] avcodec/vc1_parser: Don't call ff_vc1_init_common()
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (3 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 05/19] avcodec/vc1_parser: Set parse_only only once Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 07/19] avcodec/vc1: Move setting res_fasttx-IDCT functions to vc1dec.c Andreas Rheinhardt
` (18 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is unnecessary to initialize the VLCs: The only VLC
that was only ever used by the code reachable from the parser
was ff_vc1_bfraction_vlc; and this VLC has been removed.
Yet vc1dsp is still needed for startcode_find_candidate.
Maybe this should be factored out of vc1dsp in a later
commit.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1_parser.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c
index d57fcdf1e1..a459a2aa7d 100644
--- a/libavcodec/vc1_parser.c
+++ b/libavcodec/vc1_parser.c
@@ -29,6 +29,7 @@
#include "parser.h"
#include "vc1.h"
#include "get_bits.h"
+#include "vc1dsp.h"
/** The maximum number of bytes of a sequence, entry point or
* frame header whose values we pay any attention to */
@@ -264,7 +265,7 @@ static av_cold int vc1_parse_init(AVCodecParserContext *s)
vpc->bytes_to_skip = 0;
vpc->unesc_index = 0;
vpc->search_state = NO_MATCH;
- ff_vc1_init_common(&vpc->v);
+ ff_vc1dsp_init(&vpc->v.vc1dsp); /* startcode_find_candidate */
return 0;
}
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 07/19] avcodec/vc1: Move setting res_fasttx-IDCT functions to vc1dec.c
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (4 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 06/19] avcodec/vc1_parser: Don't call ff_vc1_init_common() Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 08/19] avcodec/vc1data: Remove duplicate defines Andreas Rheinhardt
` (17 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It allows to avoid compiling simple_idct.o for the VC-1 parser.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/Makefile | 2 +-
libavcodec/vc1.c | 11 -----------
libavcodec/vc1dec.c | 9 +++++++++
3 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 72d2f92901..739bf757f9 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1169,7 +1169,7 @@ OBJS-$(CONFIG_SBC_PARSER) += sbc_parser.o
OBJS-$(CONFIG_SIPR_PARSER) += sipr_parser.o
OBJS-$(CONFIG_TAK_PARSER) += tak_parser.o tak.o
OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \
- simple_idct.o wmv2data.o
+ wmv2data.o
OBJS-$(CONFIG_VP3_PARSER) += vp3_parser.o
OBJS-$(CONFIG_VP8_PARSER) += vp8_parser.o
OBJS-$(CONFIG_VP9_PARSER) += vp9_parser.o
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index f6468b54c7..6eb0d70a68 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -35,7 +35,6 @@
#include "vc1data.h"
#include "wmv2data.h"
#include "unary.h"
-#include "simple_idct.h"
/***********************************************************************/
/**
@@ -314,16 +313,6 @@ int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitCo
v->res_x8 = get_bits1(gb); //reserved
v->multires = get_bits1(gb);
v->res_fasttx = get_bits1(gb);
- if (!v->res_fasttx) {
- v->vc1dsp.vc1_inv_trans_8x8 = ff_simple_idct_int16_8bit;
- v->vc1dsp.vc1_inv_trans_8x4 = ff_simple_idct84_add;
- v->vc1dsp.vc1_inv_trans_4x8 = ff_simple_idct48_add;
- v->vc1dsp.vc1_inv_trans_4x4 = ff_simple_idct44_add;
- v->vc1dsp.vc1_inv_trans_8x8_dc = ff_simple_idct_add_int16_8bit;
- v->vc1dsp.vc1_inv_trans_8x4_dc = ff_simple_idct84_add;
- v->vc1dsp.vc1_inv_trans_4x8_dc = ff_simple_idct48_add;
- v->vc1dsp.vc1_inv_trans_4x4_dc = ff_simple_idct44_add;
- }
v->fastuvmc = get_bits1(gb); //common
if (!v->profile && !v->fastuvmc) {
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index fa6b5cfd3c..2cb39430f5 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -40,6 +40,7 @@
#include "msmpeg4data.h"
#include "msmpeg4dec.h"
#include "profiles.h"
+#include "simple_idct.h"
#include "vc1.h"
#include "vc1data.h"
#include "libavutil/avassert.h"
@@ -562,6 +563,14 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
memcpy(v->zz_8x8, ff_wmv1_scantable, 4*64);
v->left_blk_sh = 3;
v->top_blk_sh = 0;
+ v->vc1dsp.vc1_inv_trans_8x8 = ff_simple_idct_int16_8bit;
+ v->vc1dsp.vc1_inv_trans_8x4 = ff_simple_idct84_add;
+ v->vc1dsp.vc1_inv_trans_4x8 = ff_simple_idct48_add;
+ v->vc1dsp.vc1_inv_trans_4x4 = ff_simple_idct44_add;
+ v->vc1dsp.vc1_inv_trans_8x8_dc = ff_simple_idct_add_int16_8bit;
+ v->vc1dsp.vc1_inv_trans_8x4_dc = ff_simple_idct84_add;
+ v->vc1dsp.vc1_inv_trans_4x8_dc = ff_simple_idct48_add;
+ v->vc1dsp.vc1_inv_trans_4x4_dc = ff_simple_idct44_add;
}
if (avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 08/19] avcodec/vc1data: Remove duplicate defines
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (5 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 07/19] avcodec/vc1: Move setting res_fasttx-IDCT functions to vc1dec.c Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 09/19] avcodec/vc1data: Remove declarations of inexistent arrays Andreas Rheinhardt
` (16 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The defines in vc1data.c are duplicates of the ones in vc1data.h;
they are also pointless, because they are not used anywhere.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1data.c | 21 +--------------------
libavcodec/vc1data.h | 3 ++-
2 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c
index 01a9767d51..004b1347d4 100644
--- a/libavcodec/vc1data.c
+++ b/libavcodec/vc1data.c
@@ -98,50 +98,31 @@ const uint8_t ff_vc1_pquant_table[3][32] = {
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31 }
};
-/** @name VC-1 VLC tables and defines
+/** @name VC-1 VLC tables
* @todo TODO move this into the context
*/
//@{
-#define VC1_IMODE_VLC_BITS 4
VLC ff_vc1_imode_vlc;
-#define VC1_NORM2_VLC_BITS 3
VLC ff_vc1_norm2_vlc;
-#define VC1_NORM6_VLC_BITS 9
VLC ff_vc1_norm6_vlc;
/* Could be optimized, one table only needs 8 bits */
-#define VC1_TTMB_VLC_BITS 9 //12
VLC ff_vc1_ttmb_vlc[3];
-#define VC1_MV_DIFF_VLC_BITS 9 //15
VLC ff_vc1_mv_diff_vlc[4];
-#define VC1_CBPCY_P_VLC_BITS 9 //14
VLC ff_vc1_cbpcy_p_vlc[4];
-#define VC1_ICBPCY_VLC_BITS 9
VLC ff_vc1_icbpcy_vlc[8];
-#define VC1_4MV_BLOCK_PATTERN_VLC_BITS 6
VLC ff_vc1_4mv_block_pattern_vlc[4];
-#define VC1_2MV_BLOCK_PATTERN_VLC_BITS 3
VLC ff_vc1_2mv_block_pattern_vlc[4];
-#define VC1_TTBLK_VLC_BITS 5
VLC ff_vc1_ttblk_vlc[3];
-#define VC1_SUBBLKPAT_VLC_BITS 6
VLC ff_vc1_subblkpat_vlc[3];
-#define VC1_INTFR_4MV_MBMODE_VLC_BITS 9
VLC ff_vc1_intfr_4mv_mbmode_vlc[4];
-#define VC1_INTFR_NON4MV_MBMODE_VLC_BITS 6
VLC ff_vc1_intfr_non4mv_mbmode_vlc[4];
-#define VC1_IF_MMV_MBMODE_VLC_BITS 5
VLC ff_vc1_if_mmv_mbmode_vlc[8];
-#define VC1_IF_1MV_MBMODE_VLC_BITS 5
VLC ff_vc1_if_1mv_mbmode_vlc[8];
-#define VC1_1REF_MVDATA_VLC_BITS 9
VLC ff_vc1_1ref_mvdata_vlc[4];
-#define VC1_2REF_MVDATA_VLC_BITS 9
VLC ff_vc1_2ref_mvdata_vlc[8];
VLC ff_vc1_ac_coeff_table[8];
-#define VC1_IF_MBMODE_VLC_BITS 5 // as a placeholder for VC1_IF_MMV_MBMODE_VLC_BITS
- // or VC1_IF_1MV_MBMODE_VLC_BITS since they are the same
//@}
diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h
index 3e45ef1e79..ee4ec83263 100644
--- a/libavcodec/vc1data.h
+++ b/libavcodec/vc1data.h
@@ -91,7 +91,8 @@ extern VLC ff_vc1_2ref_mvdata_vlc[8];
extern VLC ff_vc1_ac_coeff_table[8];
-#define VC1_IF_MBMODE_VLC_BITS 5
+#define VC1_IF_MBMODE_VLC_BITS 5 // as a placeholder for VC1_IF_MMV_MBMODE_VLC_BITS
+ // or VC1_IF_1MV_MBMODE_VLC_BITS since they are the same
//@}
#define B_FRACTION_DEN 256
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 09/19] avcodec/vc1data: Remove declarations of inexistent arrays
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (6 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 08/19] avcodec/vc1data: Remove duplicate defines Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 10/19] avcodec/vc1data: Move VLC codes/lengths tables to a header Andreas Rheinhardt
` (15 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
ff_vc1_norm6_spec has been removed in commit
356be9307cbffa1226bed52b26aa2ac9c7af174f (and it seems that it
has never been used); the declarations of the 8x8_zz arrays meanwhile
have been added in f0c02e1cbc71043ffe8c1fa44f12330a63f9df10
without having ever been defined.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1data.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h
index ee4ec83263..b73e0a5f0e 100644
--- a/libavcodec/vc1data.h
+++ b/libavcodec/vc1data.h
@@ -112,8 +112,6 @@ extern const uint8_t ff_vc1_norm2_codes[4];
extern const uint8_t ff_vc1_norm2_bits[4];
extern const uint16_t ff_vc1_norm6_codes[64];
extern const uint8_t ff_vc1_norm6_bits[64];
-/* Normal-6 imode */
-extern const uint8_t ff_vc1_norm6_spec[64][5];
/* 4MV Block pattern VLC tables */
extern const uint8_t ff_vc1_4mv_block_pattern_codes[4][16];
@@ -187,8 +185,6 @@ extern const uint8_t ff_vc1_adv_interlaced_8x8_zz [64];
extern const uint8_t ff_vc1_adv_interlaced_8x4_zz [32];
extern const uint8_t ff_vc1_adv_interlaced_4x8_zz [32];
extern const uint8_t ff_vc1_adv_interlaced_4x4_zz [16];
-extern const uint8_t ff_vc1_intra_horz_8x8_zz [64];
-extern const uint8_t ff_vc1_intra_vert_8x8_zz [64];
/* DQScale as specified in 8.1.3.9 - almost identical to 0x40000/i */
extern const int32_t ff_vc1_dqscale[63];
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 10/19] avcodec/vc1data: Move VLC codes/lengths tables to a header
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (7 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 09/19] avcodec/vc1data: Remove declarations of inexistent arrays Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 11/19] avcodec/vc1: Move ff_vc1_init_common() to vc1dec.c Andreas Rheinhardt
` (14 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
and include said header at the place where the VLCs are created.
This allows to make said tables static.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1.c | 69 ++--
libavcodec/vc1_vlc_data.h | 842 ++++++++++++++++++++++++++++++++++++++
libavcodec/vc1data.c | 804 ------------------------------------
libavcodec/vc1data.h | 70 ----
4 files changed, 877 insertions(+), 908 deletions(-)
create mode 100644 libavcodec/vc1_vlc_data.h
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 6eb0d70a68..5214bcdedf 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -33,6 +33,7 @@
#include "mpegvideo.h"
#include "vc1.h"
#include "vc1data.h"
+#include "vc1_vlc_data.h"
#include "wmv2data.h"
#include "unary.h"
@@ -1575,47 +1576,47 @@ static av_cold void vc1_init_static(void)
static VLCElem vlc_table[32372];
INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
- ff_vc1_norm2_bits, 1, 1,
- ff_vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS);
+ vc1_norm2_bits, 1, 1,
+ vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS);
INIT_VLC_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64,
- ff_vc1_norm6_bits, 1, 1,
- ff_vc1_norm6_codes, 2, 2, 556);
+ vc1_norm6_bits, 1, 1,
+ vc1_norm6_codes, 2, 2, 556);
INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7,
- ff_vc1_imode_bits, 1, 1,
- ff_vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS);
+ vc1_imode_bits, 1, 1,
+ vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS);
for (int i = 0; i < 3; i++) {
ff_vc1_ttmb_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 0]];
ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0];
init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16,
- ff_vc1_ttmb_bits[i], 1, 1,
- ff_vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
+ vc1_ttmb_bits[i], 1, 1,
+ vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]];
ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1];
init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8,
- ff_vc1_ttblk_bits[i], 1, 1,
- ff_vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ vc1_ttblk_bits[i], 1, 1,
+ vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]];
ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2];
init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15,
- ff_vc1_subblkpat_bits[i], 1, 1,
- ff_vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ vc1_subblkpat_bits[i], 1, 1,
+ vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
}
for (int i = 0; i < 4; i++) {
ff_vc1_4mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 9]];
ff_vc1_4mv_block_pattern_vlc[i].table_allocated = vlc_offs[i * 3 + 10] - vlc_offs[i * 3 + 9];
init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16,
- ff_vc1_4mv_block_pattern_bits[i], 1, 1,
- ff_vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ vc1_4mv_block_pattern_bits[i], 1, 1,
+ vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
ff_vc1_cbpcy_p_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 10]];
ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10];
init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64,
- ff_vc1_cbpcy_p_bits[i], 1, 1,
- ff_vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
+ vc1_cbpcy_p_bits[i], 1, 1,
+ vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]];
ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11];
init_vlc(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73,
- ff_vc1_mv_diff_bits[i], 1, 1,
- ff_vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
+ vc1_mv_diff_bits[i], 1, 1,
+ vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
}
for (int i = 0; i < 8; i++) {
ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]];
@@ -1627,55 +1628,55 @@ static av_cold void vc1_init_static(void)
ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]];
ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22];
init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126,
- ff_vc1_2ref_mvdata_bits[i], 1, 1,
- ff_vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
+ vc1_2ref_mvdata_bits[i], 1, 1,
+ vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
}
for (int i = 0; i < 4; i++) {
/* initialize 4MV MBMODE VLC tables for interlaced frame P picture */
ff_vc1_intfr_4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 37]];
ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37];
init_vlc(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15,
- ff_vc1_intfr_4mv_mbmode_bits[i], 1, 1,
- ff_vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
+ vc1_intfr_4mv_mbmode_bits[i], 1, 1,
+ vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
/* initialize NON-4MV MBMODE VLC tables for the same */
ff_vc1_intfr_non4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 38]];
ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38];
init_vlc(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9,
- ff_vc1_intfr_non4mv_mbmode_bits[i], 1, 1,
- ff_vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ vc1_intfr_non4mv_mbmode_bits[i], 1, 1,
+ vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
/* initialize interlaced MVDATA tables (1-Ref) */
ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]];
ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39];
init_vlc(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72,
- ff_vc1_1ref_mvdata_bits[i], 1, 1,
- ff_vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
+ vc1_1ref_mvdata_bits[i], 1, 1,
+ vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
}
for (int i = 0; i < 4; i++) {
/* Initialize 2MV Block pattern VLC tables */
ff_vc1_2mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i + 49]];
ff_vc1_2mv_block_pattern_vlc[i].table_allocated = vlc_offs[i + 50] - vlc_offs[i + 49];
init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4,
- ff_vc1_2mv_block_pattern_bits[i], 1, 1,
- ff_vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ vc1_2mv_block_pattern_bits[i], 1, 1,
+ vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
}
for (int i = 0; i < 8; i++) {
/* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */
ff_vc1_icbpcy_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 53]];
ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53];
init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63,
- ff_vc1_icbpcy_p_bits[i], 1, 1,
- ff_vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
+ vc1_icbpcy_p_bits[i], 1, 1,
+ vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
/* Initialize interlaced field picture MBMODE VLC tables */
ff_vc1_if_mmv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 54]];
ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54];
init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8,
- ff_vc1_if_mmv_mbmode_bits[i], 1, 1,
- ff_vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ vc1_if_mmv_mbmode_bits[i], 1, 1,
+ vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
ff_vc1_if_1mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 55]];
ff_vc1_if_1mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 56] - vlc_offs[i * 3 + 55];
init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6,
- ff_vc1_if_1mv_mbmode_bits[i], 1, 1,
- ff_vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ vc1_if_1mv_mbmode_bits[i], 1, 1,
+ vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
}
}
diff --git a/libavcodec/vc1_vlc_data.h b/libavcodec/vc1_vlc_data.h
new file mode 100644
index 0000000000..2063269a24
--- /dev/null
+++ b/libavcodec/vc1_vlc_data.h
@@ -0,0 +1,842 @@
+/*
+ * VC-1 and WMV3 decoder VLC table data
+ * copyright (c) 2011 Mashiat Sarker Shakkhar
+ * copyright (c) 2006 Konstantin Shishkov
+ * (c) 2005 anonymous, Alex Beregszaszi, Michael Niedermayer
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * VC-1 tables.
+ */
+
+#ifndef AVCODEC_VC1_VLC_DATA_H
+#define AVCODEC_VC1_VLC_DATA_H
+
+#include <stdint.h>
+
+#include "vc1data.h"
+
+/* BitPlane IMODE - such a small table... */
+static const uint8_t vc1_imode_codes[7] = {
+ 0, 2, 1, 3, 1, 2, 3
+};
+static const uint8_t vc1_imode_bits[7] = {
+ 4, 2, 3, 2, 4, 3, 3
+};
+
+/* Normal-2 imode */
+static const uint8_t vc1_norm2_codes[4] = {
+ 0, 4, 5, 3
+};
+static const uint8_t vc1_norm2_bits[4] = {
+ 1, 3, 3, 2
+};
+
+static const uint16_t vc1_norm6_codes[64] = {
+ 0x001, 0x002, 0x003, 0x000, 0x004, 0x001, 0x002, 0x047, 0x005, 0x003, 0x004, 0x04B, 0x005, 0x04D, 0x04E, 0x30E,
+ 0x006, 0x006, 0x007, 0x053, 0x008, 0x055, 0x056, 0x30D, 0x009, 0x059, 0x05A, 0x30C, 0x05C, 0x30B, 0x30A, 0x037,
+ 0x007, 0x00A, 0x00B, 0x043, 0x00C, 0x045, 0x046, 0x309, 0x00D, 0x049, 0x04A, 0x308, 0x04C, 0x307, 0x306, 0x036,
+ 0x00E, 0x051, 0x052, 0x305, 0x054, 0x304, 0x303, 0x035, 0x058, 0x302, 0x301, 0x034, 0x300, 0x033, 0x032, 0x007,
+};
+
+static const uint8_t vc1_norm6_bits[64] = {
+ 1, 4, 4, 8, 4, 8, 8, 10, 4, 8, 8, 10, 8, 10, 10, 13,
+ 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9,
+ 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9,
+ 8, 10, 10, 13, 10, 13, 13, 9, 10, 13, 13, 9, 13, 9, 9, 6,
+};
+
+/* 4MV Block pattern VLC tables */
+static const uint8_t vc1_4mv_block_pattern_codes[4][16] = {
+ { 14, 58, 59, 25, 12, 26, 15, 15, 13, 24, 27, 0, 28, 1, 2, 2 },
+ { 8, 18, 19, 4, 20, 5, 30, 11, 21, 31, 6, 12, 7, 13, 14, 0 },
+ { 15, 6, 7, 2, 8, 3, 28, 9, 10, 29, 4, 11, 5, 12, 13, 0 },
+ { 0, 11, 12, 4, 13, 5, 30, 16, 14, 31, 6, 17, 7, 18, 19, 10 }
+};
+static const uint8_t vc1_4mv_block_pattern_bits[4][16] = {
+ { 5, 6, 6, 5, 5, 5, 5, 4, 5, 5, 5, 3, 5, 3, 3, 2 },
+ { 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4, 4, 4, 4, 4, 2 },
+ { 4, 4, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 4, 3 },
+ { 2, 4, 4, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4 }
+};
+
+/* 2MV Block pattern VLC tables */
+static const uint8_t vc1_2mv_block_pattern_codes[4][4] = {
+ { 2, 1, 0, 3 }, { 1, 0, 2, 3 }, { 2, 0, 3, 1 }, { 1, 3, 2, 0 }
+};
+
+static const uint8_t vc1_2mv_block_pattern_bits[4][4] = {
+ { 2, 2, 2, 2 }, { 1, 2, 3, 3 }, { 3, 2, 3, 1 }, { 1, 3, 3, 2 }
+};
+
+/* Interlaced frame picture 4MV MBMODE VLC tables (p. 246, p. 360) */
+static const uint16_t vc1_intfr_4mv_mbmode_codes[4][15] = {
+ { 22, 17, 0, 47, 32, 10, 1, 3, 67, 133, 132, 92, 19, 93, 18 },
+ { 3, 45, 0, 7, 23, 6, 1, 2, 10, 39, 44, 8, 18, 77, 76 },
+ { 15, 6, 28, 9, 41, 6, 2, 15, 14, 8, 40, 29, 0, 21, 11 },
+ { 7, 198, 1, 2, 193, 13, 25, 0, 97, 1599, 98, 398, 798, 192, 1598 }
+};
+
+static const uint8_t vc1_intfr_4mv_mbmode_bits[4][15] = {
+ { 5, 5, 2, 6, 6, 4, 2, 2, 7, 8, 8, 7, 5, 7, 5 },
+ { 3, 6, 3, 3, 5, 3, 3, 3, 4, 6, 6, 4, 5, 7, 7 },
+ { 4, 3, 5, 5, 7, 4, 2, 5, 5, 5, 7, 5, 2, 6, 5 },
+ { 4, 9, 1, 3, 9, 5, 6, 2, 8, 12, 8, 10, 11, 9, 12 }
+};
+
+/* Interlaced frame picture NON-4MV MBMODE VLC tables (p. 363) */
+static const uint8_t vc1_intfr_non4mv_mbmode_codes[4][9] = {
+ { 9, 22, 0, 17, 16, 10, 1, 3, 23 },
+ { 7, 0, 5, 2, 1, 1, 6, 3, 4 },
+ { 1, 0, 10, 23, 44, 8, 3, 9, 45 },
+ { 7, 97, 1, 2, 49, 13, 25, 0, 96 }
+};
+
+static const uint8_t vc1_intfr_non4mv_mbmode_bits[4][9] = {
+ { 4, 5, 2, 5, 5, 4, 2, 2, 5 },
+ { 3, 4, 6, 2, 3, 2, 3, 5, 6 },
+ { 2, 2, 4, 5, 6, 4, 2, 4, 6 },
+ { 4, 8, 1, 3, 7, 5, 6, 2, 8 }
+};
+
+/* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */
+/* mixed-MV */
+static const uint8_t vc1_if_mmv_mbmode_codes[8][8] = {
+ { 16, 17, 3, 3, 0, 5, 9, 2 },
+ { 8, 9, 3, 6, 7, 0, 5, 2 },
+ { 16, 17, 5, 3, 0, 3, 9, 2 },
+ { 56, 57, 15, 4, 5, 6, 29, 0 },
+ { 52, 53, 27, 14, 15, 2, 12, 0 },
+ { 56, 57, 29, 5, 6, 0, 15, 4 },
+ { 16, 17, 6, 7, 0, 1, 9, 5 },
+ { 56, 57, 0, 5, 6, 29, 4, 15 }
+};
+static const uint8_t vc1_if_mmv_mbmode_bits[8][8] = {
+ { 6, 6, 2, 3, 2, 4, 5, 2 },
+ { 5, 5, 3, 3, 3, 2, 4, 2 },
+ { 6, 6, 4, 3, 2, 2, 5, 2 },
+ { 6, 6, 4, 3, 3, 3, 5, 1 },
+ { 6, 6, 5, 4, 4, 2, 4, 1 },
+ { 6, 6, 5, 3, 3, 1, 4, 3 },
+ { 5, 5, 3, 3, 2, 2, 4, 3 },
+ { 6, 6, 1, 3, 3, 5, 3, 4 }
+};
+
+/* 1MV */
+static const uint8_t vc1_if_1mv_mbmode_codes[8][6] = {
+ { 0, 1, 1, 1, 1, 1 },
+ { 0, 1, 1, 1, 1, 1 },
+ { 16, 17, 3, 0, 9, 5 },
+ { 20, 21, 3, 11, 0, 4 },
+ { 4, 5, 2, 3, 3, 0 },
+ { 4, 5, 3, 2, 0, 3 },
+ { 0, 1, 1, 1, 1, 1 },
+ { 16, 17, 9, 5, 3, 0 }
+};
+static const uint8_t vc1_if_1mv_mbmode_bits[8][6] = {
+ { 5, 5, 1, 3, 2, 4 },
+ { 5, 5, 1, 2, 3, 4 },
+ { 5, 5, 2, 1, 4, 3 },
+ { 5, 5, 2, 4, 1, 3 },
+ { 4, 4, 2, 3, 2, 2 },
+ { 4, 4, 3, 2, 2, 2 },
+ { 5, 5, 3, 4, 1, 2 },
+ { 5, 5, 4, 3, 2, 1 }
+};
+
+/* Interlaced frame/field picture MVDATA VLC tables */
+
+/* 1-reference tables */
+static const uint32_t vc1_1ref_mvdata_codes[4][72] = { /* uint32_t may be too big */
+ {
+ 0x00005, 0x0000C, 0x0001E, 0x00012, 0x0000C, 0x00034, 0x00075, 0x00070,
+ 0x00000, 0x00008, 0x0001B, 0x00008, 0x0001D, 0x0007C, 0x000D6, 0x001DE,
+ 0x001AF, 0x00005, 0x0001B, 0x00026, 0x0001E, 0x00012, 0x00076, 0x0004D,
+ 0x001F6, 0x001F4, 0x00039, 0x0007F, 0x00027, 0x0006A, 0x00071, 0x00035,
+ 0x00071, 0x00068, 0x001DC, 0x00027, 0x00073, 0x000FF, 0x000E8, 0x000E9,
+ 0x0007E, 0x001F9, 0x001F5, 0x001FD, 0x0003E, 0x001CA, 0x003F9, 0x0004C,
+ 0x00069, 0x001FA, 0x001DF, 0x001F7, 0x00070, 0x001DD, 0x00E4D, 0x00727,
+ 0x00392, 0x001C8, 0x001CB, 0x003F8, 0x001AE, 0x001F8, 0x001FB, 0x0E4CE,
+ 0x0E4CF, 0x07260, 0x07261, 0x07262, 0x07263, 0x07264, 0x07265, 0x07266
+ },
+ {
+ 0x00007, 0x00001, 0x00007, 0x00016, 0x00001, 0x00045, 0x00018, 0x002B6,
+ 0x00006, 0x00004, 0x00017, 0x00010, 0x00029, 0x0002C, 0x0015A, 0x00066,
+ 0x0019E, 0x00009, 0x00028, 0x00017, 0x00000, 0x0002A, 0x00004, 0x0005B,
+ 0x000B5, 0x000CE, 0x00006, 0x00044, 0x0000F, 0x00046, 0x0000E, 0x000AC,
+ 0x00032, 0x00037, 0x011EB, 0x0000A, 0x0001A, 0x0011F, 0x00016, 0x00014,
+ 0x0002B, 0x00168, 0x00055, 0x023D5, 0x00057, 0x0002F, 0x00036, 0x0002E,
+ 0x00169, 0x00054, 0x0047B, 0x0019F, 0x02B7D, 0x0008E, 0x00ADE, 0x00479,
+ 0x0056E, 0x008F4, 0x015BF, 0x00478, 0x023D4, 0x0ADF1, 0x056F9, 0xADF0E,
+ 0xADF0F, 0x56F80, 0x56F81, 0x56F82, 0x56F83, 0x56F84, 0x56F85, 0x56F86
+ },
+ {
+ 0x00002, 0x00006, 0x00007, 0x0000D, 0x00007, 0x00030, 0x000FF, 0x001F0,
+ 0x00002, 0x00000, 0x00005, 0x00019, 0x0001E, 0x00007, 0x00063, 0x000FD,
+ 0x00023, 0x0000E, 0x0001B, 0x0001A, 0x00006, 0x00009, 0x00018, 0x000C5,
+ 0x00033, 0x001F1, 0x00002, 0x003FB, 0x001F3, 0x00022, 0x001FC, 0x00042,
+ 0x00623, 0x00083, 0x00620, 0x0007D, 0x00040, 0x00043, 0x003E4, 0x003E5,
+ 0x00191, 0x00FE9, 0x00105, 0x00208, 0x000FC, 0x00624, 0x00622, 0x00190,
+ 0x00626, 0x007F5, 0x00C4B, 0x01FD0, 0x0104D, 0x00065, 0x00C42, 0x000C9,
+ 0x00627, 0x00C43, 0x00C4A, 0x0104E, 0x01FD1, 0x0104F, 0x00412, 0x104CE,
+ 0x104CF, 0x08260, 0x08261, 0x08262, 0x08263, 0x08264, 0x08265, 0x08266
+ },
+ {
+ 0x0000D, 0x00001, 0x00004, 0x00000, 0x00017, 0x00005, 0x0007F, 0x0004D,
+ 0x00003, 0x00011, 0x0003E, 0x0003B, 0x00017, 0x00067, 0x0004A, 0x000C3,
+ 0x000F2, 0x0000A, 0x0002C, 0x00032, 0x0003D, 0x00015, 0x00028, 0x00093,
+ 0x000CC, 0x00096, 0x00003, 0x00075, 0x00020, 0x0002D, 0x00021, 0x00029,
+ 0x00090, 0x001D0, 0x001FB, 0x0001C, 0x0004C, 0x00060, 0x00009, 0x00008,
+ 0x0002D, 0x0009F, 0x001FA, 0x0013D, 0x00031, 0x000FC, 0x00058, 0x00092,
+ 0x000F0, 0x000F1, 0x000CD, 0x00185, 0x00165, 0x0004E, 0x00091, 0x000E9,
+ 0x00184, 0x001D1, 0x001E6, 0x00097, 0x001E7, 0x000B3, 0x0013C, 0x0164E,
+ 0x0164F, 0x00B20, 0x00B21, 0x00B22, 0x00B23, 0x00B24, 0x00B25, 0x00B26
+ }
+};
+
+static const uint8_t vc1_1ref_mvdata_bits[4][72] = {
+ {
+ 3, 4, 5, 5, 5, 6, 7, 7, 2, 4, 5, 5, 6, 7, 8, 9, 9, 4,
+ 6, 6, 6, 6, 7, 8, 9, 9, 6, 8, 7, 7, 7, 7, 8, 8, 9, 6,
+ 8, 8, 8, 8, 8, 9, 9, 9, 7, 10, 10, 8, 8, 9, 9, 9, 8, 9,
+ 13, 12, 11, 10, 10, 10, 9, 9, 9, 17, 17, 16, 16, 16, 16, 16, 16, 16
+ },
+ {
+ 3, 3, 4, 5, 5, 7, 8, 10, 3, 4, 5, 5, 6, 7, 9, 10, 12, 4,
+ 6, 6, 5, 6, 6, 8, 9, 11, 4, 7, 7, 7, 7, 8, 9, 9, 13, 5,
+ 8, 9, 8, 8, 9, 10, 10, 14, 7, 9, 9, 9, 10, 10, 11, 12, 14, 8,
+ 12, 11, 11, 12, 13, 11, 14, 16, 15, 20, 20, 19, 19, 19, 19, 19, 19, 19
+ },
+ {
+ 3, 4, 4, 4, 5, 6, 8, 9, 2, 4, 5, 5, 5, 6, 7, 8, 8, 4,
+ 7, 7, 6, 6, 7, 8, 8, 9, 5, 10, 9, 8, 9, 9, 11, 10, 11, 7,
+ 9, 9, 10, 10, 11, 12, 11, 12, 8, 11, 11, 11, 11, 11, 12, 13, 15, 9,
+ 12, 10, 11, 12, 12, 15, 13, 15, 13, 19, 19, 18, 18, 18, 18, 18, 18, 18
+ },
+ {
+ 4, 4, 4, 4, 5, 5, 7, 7, 3, 5, 6, 6, 6, 7, 7, 8, 8, 4,
+ 6, 6, 6, 6, 7, 8, 8, 8, 4, 7, 6, 6, 6, 7, 8, 9, 9, 5,
+ 7, 7, 6, 6, 7, 8, 9, 9, 6, 8, 8, 8, 8, 8, 8, 9, 10, 7,
+ 8, 8, 9, 9, 9, 8, 9, 9, 9, 14, 14, 13, 13, 13, 13, 13, 13, 13
+ }
+};
+
+/* 2-reference tables */
+static const uint32_t vc1_2ref_mvdata_codes[8][126] = { /* table 132 - table 139 */
+ {
+ 0x0000C, 0x0001C, 0x0000B, 0x00000, 0x0000E, 0x0002A, 0x00050, 0x00368,
+ 0x00002, 0x0001A, 0x00004, 0x0003A, 0x0001D, 0x0006C, 0x000EF, 0x001BC,
+ 0x0015F, 0x0000F, 0x00003, 0x0001C, 0x0000D, 0x0000B, 0x0003E, 0x000A7,
+ 0x00146, 0x00199, 0x00006, 0x0001F, 0x00004, 0x0003C, 0x00007, 0x001BE,
+ 0x0008B, 0x0002C, 0x007B3, 0x00005, 0x000DB, 0x00056, 0x000EC, 0x00052,
+ 0x001BD, 0x00078, 0x000CF, 0x00573, 0x00009, 0x00023, 0x000ED, 0x00018,
+ 0x00006, 0x00044, 0x000F5, 0x00079, 0x006D2, 0x0006E, 0x0002B, 0x0015D,
+ 0x00017, 0x0037F, 0x00144, 0x000CE, 0x00028, 0x000AB, 0x00010, 0x001B5,
+ 0x000F7, 0x000A6, 0x0007B, 0x00028, 0x001ED, 0x001E9, 0x006FD, 0x00004,
+ 0x000F5, 0x00029, 0x0028A, 0x0028B, 0x0028F, 0x00DF9, 0x00335, 0x01E85,
+ 0x000EE, 0x002BD, 0x0002B, 0x003D8, 0x003D1, 0x00198, 0x001E9, 0x0051D,
+ 0x000B4, 0x0003F, 0x00455, 0x0022B, 0x00229, 0x00451, 0x00578, 0x007B2,
+ 0x00570, 0x00155, 0x00032, 0x003D0, 0x00054, 0x006D3, 0x00571, 0x00454,
+ 0x00334, 0x01BF1, 0x000B7, 0x00029, 0x01E84, 0x0016C, 0x0019B, 0x01BF0,
+ 0x00579, 0x00F43, 0x000B5, 0x008A1, 0x0002A, 0x0016D, 0x008A0, 0x007A0,
+ 0x003D1, 0x00AE5, 0x00154, 0x00AE4, 0x00A39, 0x00A38
+ },
+ {
+ 0x00003, 0x00009, 0x00016, 0x00010, 0x000D7, 0x00335, 0x00574, 0x00555,
+ 0x00000, 0x0001D, 0x00009, 0x00017, 0x0002C, 0x000AD, 0x00374, 0x006B3,
+ 0x00577, 0x0000F, 0x00018, 0x0000A, 0x0002E, 0x00022, 0x0017C, 0x00E7B,
+ 0x01B89, 0x015D8, 0x00008, 0x00034, 0x0006D, 0x00023, 0x001C2, 0x00376,
+ 0x002D3, 0x01C4A, 0x0330A, 0x00014, 0x0006A, 0x00072, 0x0006C, 0x000E3,
+ 0x0019B, 0x0073F, 0x01CF0, 0x00B41, 0x00032, 0x000E6, 0x000E0, 0x000CF,
+ 0x000AB, 0x0019C, 0x002AB, 0x00E2B, 0x015D9, 0x0006F, 0x001C3, 0x000AF,
+ 0x000BF, 0x000AC, 0x0017D, 0x006E3, 0x00E29, 0x01984, 0x00054, 0x000B5,
+ 0x0017A, 0x001AD, 0x00199, 0x00178, 0x00358, 0x002D2, 0x01C4B, 0x0005B,
+ 0x002A8, 0x00331, 0x00388, 0x0038B, 0x00370, 0x00713, 0x00CC3, 0x01CF1,
+ 0x001B9, 0x005EF, 0x00738, 0x002F2, 0x0033B, 0x002B9, 0x006EB, 0x00570,
+ 0x00E24, 0x0039D, 0x005A2, 0x005A3, 0x00E7D, 0x005EE, 0x00739, 0x00554,
+ 0x00AA5, 0x00AA4, 0x00377, 0x01CF5, 0x00BCE, 0x00E79, 0x00660, 0x00674,
+ 0x006EA, 0x00E7C, 0x00D65, 0x002F6, 0x015DA, 0x01B88, 0x005A1, 0x01CF4,
+ 0x005E6, 0x00E28, 0x00575, 0x00D64, 0x00334, 0x0330B, 0x015DB, 0x00B40,
+ 0x00BCF, 0x00DC5, 0x00E2A, 0x00675, 0x00571, 0x00553
+ },
+ {
+ 0x00004, 0x00002, 0x00010, 0x00003, 0x00017, 0x00045, 0x0003E, 0x0007E,
+ 0x00003, 0x00002, 0x00028, 0x0001E, 0x00015, 0x00047, 0x00002, 0x0014D,
+ 0x00060, 0x0000B, 0x00026, 0x00024, 0x00014, 0x00032, 0x0006F, 0x000C3,
+ 0x00531, 0x006E5, 0x00015, 0x0003F, 0x0002D, 0x00001, 0x0013E, 0x000DD,
+ 0x000F6, 0x00305, 0x00331, 0x0000E, 0x00003, 0x00034, 0x00033, 0x0001A,
+ 0x0014A, 0x000C5, 0x000F4, 0x006E4, 0x00001, 0x0003C, 0x0007D, 0x0008D,
+ 0x0009D, 0x00031, 0x0006E, 0x00296, 0x000CD, 0x00025, 0x00149, 0x00032,
+ 0x00089, 0x00036, 0x00088, 0x0006F, 0x00003, 0x0031D, 0x0000E, 0x001AA,
+ 0x0027E, 0x00061, 0x0014E, 0x0014F, 0x00067, 0x000FF, 0x00183, 0x00036,
+ 0x00357, 0x000F5, 0x000C6, 0x000C2, 0x00299, 0x00119, 0x00231, 0x00350,
+ 0x0002C, 0x0018F, 0x00530, 0x00297, 0x00004, 0x001B8, 0x000C0, 0x0027A,
+ 0x00311, 0x0009C, 0x00621, 0x00199, 0x0031C, 0x000F7, 0x003E3, 0x00356,
+ 0x00189, 0x00005, 0x0006B, 0x008C2, 0x00330, 0x004FF, 0x004F0, 0x00351,
+ 0x004F2, 0x001F2, 0x00373, 0x00000, 0x00C41, 0x008C3, 0x009EC, 0x003E2,
+ 0x00304, 0x004F7, 0x004F1, 0x001F0, 0x00148, 0x00C40, 0x009ED, 0x008C0,
+ 0x008C1, 0x004F3, 0x004FE, 0x000FE, 0x001F3, 0x001A9
+ },
+ {
+ 0x00000, 0x00004, 0x0002F, 0x00052, 0x00010, 0x000AD, 0x0050B, 0x00190,
+ 0x00003, 0x00016, 0x00007, 0x0000D, 0x000BB, 0x00173, 0x000C9, 0x0050F,
+ 0x0172C, 0x00003, 0x00011, 0x00005, 0x00043, 0x00023, 0x0004B, 0x0032E,
+ 0x02E5B, 0x00482, 0x00009, 0x0002A, 0x00014, 0x0002A, 0x00108, 0x005CA,
+ 0x0065A, 0x02136, 0x02132, 0x0000B, 0x00013, 0x00041, 0x000B8, 0x00174,
+ 0x00100, 0x014DA, 0x0404E, 0x01437, 0x0002B, 0x00085, 0x000A7, 0x000A0,
+ 0x0014C, 0x0029A, 0x0032C, 0x02133, 0x0142A, 0x00051, 0x00284, 0x000AC,
+ 0x00102, 0x00045, 0x00044, 0x0081B, 0x0065E, 0x00CB7, 0x00018, 0x0050C,
+ 0x00212, 0x002E4, 0x00203, 0x00094, 0x00122, 0x0081A, 0x00655, 0x00033,
+ 0x002BA, 0x00246, 0x00242, 0x00A6E, 0x0040C, 0x00808, 0x02134, 0x0404F,
+ 0x00175, 0x00405, 0x00247, 0x0012A, 0x00A14, 0x002BB, 0x00191, 0x0084F,
+ 0x01438, 0x000AF, 0x00B97, 0x00483, 0x0143B, 0x0032B, 0x00243, 0x0142B,
+ 0x00958, 0x029BF, 0x00049, 0x00A6C, 0x014DB, 0x004AD, 0x014DE, 0x0084E,
+ 0x01434, 0x00257, 0x02E5A, 0x00207, 0x01435, 0x01439, 0x00CB6, 0x0143A,
+ 0x00194, 0x00654, 0x02135, 0x0537C, 0x0015C, 0x00240, 0x01012, 0x0537D,
+ 0x00959, 0x01098, 0x01436, 0x0065F, 0x02026, 0x02137
+ },
+ {
+ 0x00005, 0x00019, 0x00016, 0x00011, 0x0003E, 0x0005E, 0x000EF, 0x000E2,
+ 0x00000, 0x00039, 0x0002B, 0x00026, 0x00028, 0x00012, 0x000C2, 0x000ED,
+ 0x0011D, 0x0000D, 0x00031, 0x0002A, 0x00025, 0x00020, 0x0005C, 0x001ED,
+ 0x0024D, 0x00770, 0x00006, 0x0007A, 0x00060, 0x0004F, 0x00048, 0x00039,
+ 0x00186, 0x00213, 0x00EC6, 0x0000F, 0x00026, 0x0005F, 0x00075, 0x00070,
+ 0x00027, 0x001DB, 0x003C6, 0x0078F, 0x0003F, 0x000A6, 0x000F0, 0x0003A,
+ 0x00052, 0x0004E, 0x000E3, 0x001D9, 0x0030F, 0x00010, 0x001DD, 0x000A7,
+ 0x000F7, 0x00022, 0x00092, 0x003C4, 0x002EF, 0x00762, 0x00079, 0x0008F,
+ 0x001DA, 0x00087, 0x000E8, 0x000BA, 0x00176, 0x000EE, 0x003B0, 0x00085,
+ 0x00119, 0x0030E, 0x00108, 0x001D2, 0x0010C, 0x00773, 0x00424, 0x00434,
+ 0x00071, 0x005DD, 0x001C1, 0x003A7, 0x00127, 0x0008D, 0x0021B, 0x007B2,
+ 0x001DF, 0x003D8, 0x00764, 0x00EE4, 0x003B3, 0x0074D, 0x001D8, 0x005DC,
+ 0x0084A, 0x00499, 0x003C5, 0x01D8E, 0x00765, 0x00435, 0x00771, 0x001C2,
+ 0x00118, 0x003BC, 0x00381, 0x00387, 0x07B33, 0x01097, 0x01096, 0x01ECD,
+ 0x00E99, 0x00F1C, 0x00F1D, 0x00EE5, 0x0011C, 0x07B32, 0x03D98, 0x01D8F,
+ 0x00E98, 0x00F67, 0x003BD, 0x00380, 0x00498, 0x00386
+ },
+ {
+ 0x0000D, 0x00010, 0x0002E, 0x00039, 0x0000D, 0x00074, 0x000ED, 0x000B6,
+ 0x00001, 0x00002, 0x00000, 0x00030, 0x00029, 0x00070, 0x000F3, 0x0008C,
+ 0x00166, 0x00009, 0x00033, 0x00078, 0x00006, 0x000C4, 0x0000B, 0x00163,
+ 0x000CC, 0x005BE, 0x0001F, 0x0002F, 0x00064, 0x00018, 0x000C6, 0x0000A,
+ 0x00162, 0x002C0, 0x00EF3, 0x00007, 0x0000F, 0x000E3, 0x000CA, 0x000B2,
+ 0x0018F, 0x003AE, 0x0075F, 0x00C51, 0x00015, 0x00047, 0x000EE, 0x000E2,
+ 0x000EA, 0x00009, 0x0016A, 0x002C3, 0x0059D, 0x0003D, 0x00008, 0x001D9,
+ 0x00032, 0x0000E, 0x0016E, 0x0032C, 0x0065B, 0x0196B, 0x00002, 0x0000F,
+ 0x001D8, 0x0008D, 0x000B4, 0x001E4, 0x00067, 0x00317, 0x00794, 0x00022,
+ 0x003BE, 0x00315, 0x00034, 0x00037, 0x002DE, 0x0006C, 0x00EFE, 0x0066C,
+ 0x00028, 0x003CB, 0x003AC, 0x00035, 0x0016B, 0x003BD, 0x002C1, 0x0062C,
+ 0x01DFE, 0x0000E, 0x0059E, 0x005BF, 0x000DA, 0x00629, 0x00584, 0x00EB7,
+ 0x00B0A, 0x0066D, 0x0000C, 0x0077E, 0x0059C, 0x00778, 0x0075E, 0x0075A,
+ 0x0062D, 0x00337, 0x00334, 0x00197, 0x01E57, 0x01DE4, 0x0196A, 0x01E56,
+ 0x00C50, 0x00B3F, 0x01E54, 0x00B0B, 0x0018E, 0x001B6, 0x01E55, 0x00CB4,
+ 0x00B3E, 0x00EB6, 0x01DE5, 0x01DFF, 0x00335, 0x001B7
+ },
+ {
+ 0x00001, 0x0000B, 0x00019, 0x0006F, 0x0002A, 0x00075, 0x007EB, 0x00163,
+ 0x00001, 0x0000E, 0x0001A, 0x0003E, 0x0001C, 0x0002D, 0x00164, 0x007EC,
+ 0x00165, 0x00004, 0x00006, 0x00036, 0x0007F, 0x000AE, 0x00158, 0x0015C,
+ 0x0056D, 0xFD510, 0x00000, 0x00004, 0x0007B, 0x000F3, 0x0003B, 0x007ED,
+ 0x002B3, 0x002CC, 0x0056E, 0x00018, 0x0003E, 0x00017, 0x0001E, 0x000AF,
+ 0x003F7, 0x0056F, 0x002CD, 0xFD511, 0x00014, 0x000AD, 0x000AA, 0x00014,
+ 0x000A8, 0x00153, 0x000E8, 0x001FE, 0x00DCF, 0x00078, 0x001B8, 0x00152,
+ 0x000FE, 0x002B1, 0x0015D, 0x00160, 0xFD512, 0xFD513, 0x0007A, 0x002B0,
+ 0x001E5, 0x000E9, 0x000FC, 0x006E6, 0x00DC8, 0x00584, 0xFD514, 0x000AB,
+ 0x00DDE, 0x00159, 0x003F4, 0x00DC9, 0x00DCA, 0x001FA, 0xFD515, 0xFD516,
+ 0x000FC, 0x001FF, 0x001E4, 0x000AF, 0x0015A, 0x00167, 0x00DCB, 0x00585,
+ 0xFD517, 0x003F7, 0x03F55, 0xFD518, 0x00DDC, 0x00586, 0x03F56, 0xFD519,
+ 0x03F57, 0xFD51A, 0x001BA, 0x00587, 0x00588, 0x00DDF, 0x002B2, 0xFD51B,
+ 0x00DCE, 0x003F6, 0xFD51C, 0x00FD4, 0xFD51D, 0xFD51E, 0xFD51F, 0x7EA80,
+ 0x7EA81, 0x0056C, 0x7EA82, 0x7EA83, 0x00376, 0x00589, 0x0058A, 0x7EA84,
+ 0x7EA85, 0x00DDD, 0x7EA86, 0x7EA87, 0x0058B, 0x07EA9
+ },
+ {
+ 0x00003, 0x0000E, 0x0000F, 0x0007E, 0x00062, 0x000C6, 0x00CD9, 0x0063E,
+ 0x00002, 0x00002, 0x00000, 0x00018, 0x0000C, 0x00069, 0x00039, 0x00707,
+ 0x00C7E, 0x00002, 0x0000D, 0x0001B, 0x0000F, 0x0019A, 0x00647, 0x01A37,
+ 0x346C4, 0x0346D, 0x00001, 0x0001E, 0x0007F, 0x0000A, 0x000E1, 0x00661,
+ 0x00CE4, 0x346C5, 0x346C6, 0x0001D, 0x00030, 0x0000D, 0x000CB, 0x00199,
+ 0x00320, 0x0008E, 0x0652E, 0x346C7, 0x0003E, 0x00039, 0x00035, 0x00033,
+ 0x0019F, 0x001C0, 0x00CDA, 0x346C8, 0x346C9, 0x0000B, 0x000D0, 0x0019E,
+ 0x00022, 0x00038, 0x0018E, 0x0031E, 0x03294, 0x0023C, 0x00032, 0x00012,
+ 0x00013, 0x00071, 0x0019D, 0x00020, 0x00C87, 0x00CC0, 0x346CA, 0x00338,
+ 0x00653, 0x001A2, 0x0032A, 0x00322, 0x00CE7, 0x00084, 0x0011F, 0x346CB,
+ 0x00325, 0x00649, 0x0032B, 0x00077, 0x00648, 0x00642, 0x00C86, 0x00C8C,
+ 0x346CC, 0x0003A, 0x019B7, 0x00043, 0x00327, 0x0008C, 0x0008D, 0x00C8D,
+ 0x346CD, 0x346CE, 0x00337, 0x00CE5, 0x00085, 0x00326, 0x00347, 0x00CA4,
+ 0x00C7F, 0x00D1A, 0x346CF, 0x00328, 0x1A360, 0x1A361, 0x00CD8, 0x0068C,
+ 0x03295, 0x03296, 0x0652F, 0x066D8, 0x00331, 0x00706, 0x0023D, 0x00076,
+ 0x00CC1, 0x00382, 0x00CE6, 0x066D9, 0x066DA, 0x066DB
+ }
+};
+
+static const uint8_t vc1_2ref_mvdata_bits[8][126] = {
+ {
+ 4, 5, 5, 5, 6, 7, 8, 10, 2, 5, 5, 6, 6, 7, 8, 9,
+ 10, 4, 5, 6, 6, 7, 8, 9, 10, 11, 4, 6, 6, 7, 7, 9,
+ 9, 10, 12, 5, 8, 8, 8, 8, 9, 9, 10, 12, 5, 7, 8, 7,
+ 7, 8, 9, 9, 11, 7, 9, 10, 9, 10, 10, 10, 10, 12, 6, 9,
+ 9, 9, 9, 9, 10, 10, 11, 7, 10, 10, 11, 11, 11, 12, 12, 14,
+ 8, 11, 10, 11, 11, 11, 11, 12, 12, 8, 12, 11, 11, 12, 12, 12,
+ 12, 13, 8, 12, 11, 11, 12, 12, 12, 13, 12, 9, 14, 13, 11, 13,
+ 12, 13, 12, 13, 9, 13, 13, 12, 12, 13, 13, 13, 13, 13
+ },
+ {
+ 3, 4, 5, 6, 8, 10, 11, 11, 2, 5, 5, 6, 7, 8, 10, 11,
+ 11, 4, 5, 5, 6, 7, 9, 12, 13, 13, 4, 6, 7, 7, 9, 10,
+ 11, 13, 14, 5, 7, 7, 7, 8, 9, 11, 13, 13, 6, 8, 8, 8,
+ 8, 9, 10, 12, 13, 7, 9, 8, 8, 8, 9, 11, 12, 13, 7, 9,
+ 9, 9, 9, 9, 10, 11, 13, 8, 10, 10, 10, 10, 10, 11, 12, 13,
+ 9, 11, 11, 10, 10, 10, 11, 11, 12, 10, 12, 12, 12, 11, 11, 11,
+ 12, 12, 10, 13, 12, 12, 11, 11, 11, 12, 12, 10, 13, 13, 12, 13,
+ 11, 12, 11, 12, 10, 14, 13, 13, 12, 12, 12, 11, 11, 11
+ },
+ {
+ 4, 4, 5, 5, 6, 7, 8, 9, 2, 5, 6, 6, 6, 7, 7, 9,
+ 9, 4, 6, 6, 6, 7, 8, 9, 11, 12, 5, 7, 7, 7, 9, 9,
+ 10, 11, 12, 5, 7, 7, 7, 7, 9, 9, 10, 12, 5, 8, 8, 8,
+ 8, 8, 9, 10, 10, 6, 9, 8, 8, 8, 8, 9, 9, 11, 6, 10,
+ 10, 9, 9, 9, 9, 10, 10, 7, 11, 10, 9, 9, 10, 9, 10, 11,
+ 7, 10, 11, 10, 10, 10, 9, 10, 11, 8, 12, 11, 11, 10, 11, 11,
+ 10, 10, 8, 12, 12, 11, 11, 11, 11, 10, 11, 8, 13, 12, 12, 11,
+ 11, 11, 11, 10, 9, 13, 12, 12, 12, 11, 11, 10, 10, 10
+ },
+ {
+ 3, 4, 6, 7, 7, 9, 11, 11, 2, 5, 5, 6, 8, 9, 10, 11,
+ 13, 3, 5, 5, 7, 8, 9, 12, 14, 13, 4, 6, 6, 7, 9, 11,
+ 13, 14, 14, 5, 7, 7, 8, 9, 9, 13, 15, 13, 6, 8, 8, 8,
+ 9, 10, 12, 14, 13, 7, 10, 9, 9, 9, 9, 12, 13, 14, 7, 11,
+ 10, 10, 10, 10, 11, 12, 13, 8, 11, 12, 12, 12, 11, 12, 14, 15,
+ 9, 11, 12, 11, 12, 11, 11, 12, 13, 9, 12, 13, 13, 12, 12, 13,
+ 14, 14, 9, 12, 13, 13, 13, 12, 13, 12, 14, 10, 13, 13, 14, 13,
+ 11, 13, 14, 15, 10, 12, 13, 15, 14, 13, 13, 13, 14, 14
+ },
+ {
+ 4, 5, 5, 5, 6, 7, 8, 8, 2, 6, 6, 6, 6, 6, 8, 9,
+ 10, 4, 6, 6, 6, 6, 7, 9, 10, 11, 4, 7, 7, 7, 7, 7,
+ 9, 10, 12, 5, 7, 7, 7, 7, 7, 9, 10, 11, 6, 8, 8, 7,
+ 7, 7, 8, 9, 10, 6, 9, 8, 8, 7, 8, 10, 10, 11, 7, 9,
+ 9, 8, 8, 8, 9, 9, 10, 8, 10, 10, 9, 9, 9, 11, 11, 11,
+ 8, 11, 10, 10, 9, 9, 10, 11, 10, 10, 12, 12, 11, 11, 10, 11,
+ 12, 11, 10, 13, 12, 11, 11, 10, 10, 11, 11, 11, 15, 13, 13, 13,
+ 12, 12, 12, 12, 10, 15, 14, 13, 12, 12, 11, 11, 11, 11
+ },
+ {
+ 4, 5, 6, 6, 6, 7, 8, 8, 2, 4, 5, 6, 6, 7, 8, 8,
+ 9, 4, 6, 7, 7, 8, 8, 9, 10, 11, 5, 6, 7, 7, 8, 8,
+ 9, 10, 12, 5, 7, 8, 8, 8, 9, 10, 11, 12, 5, 7, 8, 8,
+ 8, 8, 9, 10, 11, 6, 8, 9, 8, 8, 9, 10, 11, 13, 5, 8,
+ 9, 8, 8, 9, 9, 10, 11, 6, 10, 10, 9, 9, 10, 10, 12, 13,
+ 6, 10, 10, 9, 9, 10, 10, 11, 13, 7, 11, 11, 11, 11, 11, 12,
+ 12, 13, 7, 11, 11, 11, 11, 11, 11, 12, 12, 9, 13, 13, 13, 13,
+ 12, 12, 13, 12, 9, 12, 13, 12, 12, 12, 13, 13, 12, 12
+ },
+ {
+ 3, 5, 6, 8, 9, 10, 12, 12, 1, 5, 6, 7, 8, 9, 12, 12,
+ 12, 4, 6, 7, 8, 9, 12, 12, 14, 21, 4, 6, 8, 9, 9, 12,
+ 13, 13, 14, 6, 9, 8, 8, 9, 13, 14, 13, 21, 6, 9, 9, 8,
+ 9, 10, 11, 12, 13, 8, 10, 10, 11, 11, 12, 12, 21, 21, 8, 11,
+ 10, 11, 11, 12, 13, 14, 21, 9, 13, 10, 11, 13, 13, 12, 21, 21,
+ 9, 12, 10, 11, 12, 12, 13, 14, 21, 11, 15, 21, 13, 14, 15, 21,
+ 15, 21, 10, 14, 14, 13, 13, 21, 13, 13, 21, 13, 21, 21, 21, 20,
+ 20, 14, 20, 20, 11, 14, 14, 20, 20, 13, 20, 20, 14, 16
+ },
+ {
+ 2, 5, 6, 8, 9, 10, 13, 13, 2, 4, 5, 6, 8, 9, 10, 13,
+ 14, 3, 5, 7, 8, 10, 12, 15, 20, 16, 4, 6, 8, 8, 10, 12,
+ 13, 20, 20, 7, 8, 8, 9, 10, 11, 12, 16, 20, 7, 8, 8, 8,
+ 10, 11, 13, 20, 20, 8, 10, 10, 10, 10, 11, 12, 15, 14, 8, 9,
+ 9, 9, 10, 10, 13, 13, 20, 11, 12, 11, 11, 11, 13, 12, 13, 20,
+ 11, 12, 11, 11, 12, 12, 13, 13, 20, 10, 14, 11, 11, 12, 12, 13,
+ 20, 20, 11, 13, 12, 11, 12, 13, 14, 14, 20, 11, 19, 19, 13, 13,
+ 15, 15, 16, 16, 11, 13, 14, 11, 13, 12, 13, 16, 16, 16
+ }
+};
+
+/* P-Picture CBPCY VLC tables */
+// Looks like original tables are not conforming to standard at all. Are they used for old WMV?
+static const uint16_t vc1_cbpcy_p_codes[4][64] = {
+ {
+ 0, 6, 15, 13, 13, 11, 3, 13, 5, 8, 49, 10, 12, 114, 102, 119,
+ 1, 54, 96, 8, 10, 111, 5, 15, 12, 10, 2, 12, 13, 115, 53, 63,
+ 1, 7, 1, 7, 14, 12, 4, 14, 1, 9, 97, 11, 7, 58, 52, 62,
+ 4, 103, 1, 9, 11, 56, 101, 118, 4, 110, 100, 30, 2, 5, 4, 3
+ },
+ {
+ 0, 9, 1, 18, 5, 14, 237, 26, 3, 121, 3, 22, 13, 16, 6, 30,
+ 2, 10, 1, 20, 12, 241, 5, 28, 16, 12, 3, 24, 28, 124, 239, 247,
+ 1, 240, 1, 19, 18, 15, 4, 27, 1, 122, 2, 23, 1, 17, 7, 31,
+ 1, 11, 2, 21, 19, 246, 238, 29, 17, 13, 236, 25, 58, 63, 8, 125
+ },
+ {
+ 0, 201, 25, 231, 5, 221, 1, 3, 2, 414, 2, 241, 16, 225, 195, 492,
+ 2, 412, 1, 240, 7, 224, 98, 245, 1, 220, 96, 5, 9, 230, 101, 247,
+ 1, 102, 1, 415, 24, 3, 2, 244, 3, 54, 3, 484, 17, 114, 200, 493,
+ 3, 413, 1, 4, 13, 113, 99, 485, 4, 111, 194, 243, 5, 29, 26, 31
+ },
+ {
+ 0, 28, 12, 44, 3, 36, 20, 52, 2, 32, 16, 48, 8, 40, 24, 28,
+ 1, 30, 14, 46, 6, 38, 22, 54, 3, 34, 18, 50, 10, 42, 26, 30,
+ 1, 29, 13, 45, 5, 37, 21, 53, 2, 33, 17, 49, 9, 41, 25, 29,
+ 1, 31, 15, 47, 7, 39, 23, 55, 4, 35, 19, 51, 11, 43, 27, 31
+ }
+};
+
+static const uint8_t vc1_cbpcy_p_bits[4][64] = {
+ {
+ 13, 13, 7, 13, 7, 13, 13, 12, 6, 13, 7, 12, 6, 8, 8, 8,
+ 5, 7, 8, 12, 6, 8, 13, 12, 7, 13, 13, 12, 6, 8, 7, 7,
+ 6, 13, 8, 12, 7, 13, 13, 12, 7, 13, 8, 12, 5, 7, 7, 7,
+ 6, 8, 13, 12, 6, 7, 8, 8, 5, 8, 8, 6, 3, 3, 3, 2
+ },
+ {
+ 14, 13, 8, 13, 3, 13, 8, 13, 3, 7, 8, 13, 4, 13, 13, 13,
+ 3, 13, 13, 13, 4, 8, 13, 13, 5, 13, 13, 13, 5, 7, 8, 8,
+ 3, 8, 14, 13, 5, 13, 13, 13, 4, 7, 13, 13, 6, 13, 13, 13,
+ 5, 13, 8, 13, 5, 8, 8, 13, 5, 13, 8, 13, 6, 6, 13, 7
+ },
+ {
+ 13, 8, 6, 8, 4, 8, 13, 12, 4, 9, 8, 8, 5, 8, 8, 9,
+ 5, 9, 10, 8, 4, 8, 7, 8, 6, 8, 7, 13, 4, 8, 7, 8,
+ 5, 7, 8, 9, 6, 13, 13, 8, 4, 6, 8, 9, 5, 7, 8, 9,
+ 5, 9, 9, 13, 5, 7, 7, 9, 4, 7, 8, 8, 3, 5, 5, 5
+ },
+ {
+ 9, 9, 9, 9, 2, 9, 9, 9, 2, 9, 9, 9, 9, 9, 9, 8,
+ 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8,
+ 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8
+ }
+};
+
+/* Interlaced CBPCY VLC tables (Table 124 - Table 131) */
+static const uint16_t vc1_icbpcy_p_codes[8][63] = {
+ {
+ 0x2F1A, 0x2F1B, 0x178C, 0x0090, 0x02A8, 0x02A9, 0x0BC7, 0x0091,
+ 0x02AA, 0x02AB, 0x05E0, 0x004A, 0x0096, 0x0097, 0x00BD, 0x0092,
+ 0x02AC, 0x02AD, 0x05E1, 0x0098, 0x0132, 0x0133, 0x0179, 0x0134,
+ 0x026A, 0x026B, 0x02FC, 0x004E, 0x0040, 0x0041, 0x002B, 0x0093,
+ 0x02AE, 0x02AF, 0x05E2, 0x0136, 0x026E, 0x026F, 0x02FD, 0x009E,
+ 0x013E, 0x013F, 0x017F, 0x0050, 0x0042, 0x0043, 0x002C, 0x0051,
+ 0x00A4, 0x00A5, 0x00BE, 0x0053, 0x0044, 0x0045, 0x002D, 0x0054,
+ 0x0046, 0x0047, 0x002E, 0x0003, 0x0000, 0x0001, 0x0001
+ },
+ {
+ 0x0041, 0x0042, 0x0100, 0x0043, 0x0088, 0x0089, 0x0101, 0x0045,
+ 0x008C, 0x008D, 0x0102, 0x0010, 0x0022, 0x0023, 0x0024, 0x0047,
+ 0x0010, 0x0011, 0x0103, 0x0025, 0x0058, 0x0059, 0x005A, 0x005B,
+ 0x005A, 0x005B, 0x005C, 0x000C, 0x0030, 0x0031, 0x0019, 0x0009,
+ 0x0014, 0x0015, 0x002C, 0x005C, 0x005D, 0x005E, 0x005F, 0x0026,
+ 0x005D, 0x005E, 0x005F, 0x000D, 0x0034, 0x0035, 0x001B, 0x0014,
+ 0x0027, 0x002A, 0x002B, 0x000E, 0x0038, 0x0039, 0x001D, 0x000F,
+ 0x003C, 0x003D, 0x001F, 0x0005, 0x0009, 0x0000, 0x0003
+ },
+ {
+ 0x0032, 0x0033, 0x001A, 0x0026, 0x00E4, 0x00E5, 0x01E6, 0x0027,
+ 0x00E6, 0x00E7, 0x01E7, 0x000E, 0x0063, 0x006C, 0x0077, 0x0028,
+ 0x00E8, 0x00E9, 0x01E8, 0x007B, 0x00DA, 0x00DB, 0x00EC, 0x00F5,
+ 0x01B8, 0x01B9, 0x01DA, 0x0021, 0x004B, 0x0054, 0x002B, 0x0029,
+ 0x00EA, 0x00EB, 0x01E9, 0x004A, 0x01BA, 0x01BB, 0x01DB, 0x0020,
+ 0x00DE, 0x00DF, 0x00F2, 0x0022, 0x0055, 0x0058, 0x002D, 0x000F,
+ 0x0070, 0x0071, 0x0078, 0x0023, 0x0059, 0x005C, 0x002F, 0x0024,
+ 0x005D, 0x0062, 0x0030, 0x0002, 0x001F, 0x0006, 0x0000
+ },
+ {
+ 0x0028, 0x0029, 0x009D, 0x0000, 0x01EA, 0x01EB, 0x01EC, 0x0001,
+ 0x01ED, 0x01EE, 0x01EF, 0x0005, 0x00F0, 0x00F1, 0x003B, 0x0002,
+ 0x01F0, 0x01F1, 0x01F2, 0x003F, 0x015C, 0x015D, 0x0099, 0x0010,
+ 0x03D0, 0x03D1, 0x0130, 0x000F, 0x009E, 0x009F, 0x00FB, 0x0003,
+ 0x01F3, 0x01F4, 0x01F5, 0x0011, 0x03D2, 0x03D3, 0x0131, 0x0009,
+ 0x015E, 0x015F, 0x009C, 0x0010, 0x00A8, 0x00A9, 0x0038, 0x0006,
+ 0x00F2, 0x00F3, 0x004D, 0x0011, 0x00AA, 0x00AB, 0x0039, 0x0012,
+ 0x00AC, 0x00AD, 0x003A, 0x0006, 0x0016, 0x0017, 0x000E
+ },
+ {
+ 0x003C, 0x003D, 0x001F, 0x000A, 0x0061, 0x0062, 0x0002, 0x000B,
+ 0x0063, 0x0064, 0x0003, 0x0007, 0x0003, 0x0004, 0x000B, 0x000C,
+ 0x0065, 0x0066, 0x0004, 0x0012, 0x000A, 0x000B, 0x0014, 0x001B,
+ 0x0018, 0x0019, 0x0034, 0x002C, 0x0067, 0x0068, 0x0035, 0x000D,
+ 0x0069, 0x006C, 0x0005, 0x0060, 0x001A, 0x001B, 0x0035, 0x0013,
+ 0x000E, 0x000F, 0x0015, 0x002D, 0x006D, 0x006E, 0x0038, 0x0008,
+ 0x0008, 0x0009, 0x000C, 0x002E, 0x006F, 0x0072, 0x003A, 0x002F,
+ 0x0073, 0x0000, 0x003B, 0x0007, 0x0014, 0x0015, 0x0004
+ },
+ {
+ 0x0038, 0x0039, 0x009D, 0x000A, 0x0091, 0x0092, 0x0093, 0x000B,
+ 0x0094, 0x0095, 0x0096, 0x0003, 0x00EE, 0x00EF, 0x0036, 0x000C,
+ 0x0097, 0x0098, 0x0099, 0x0008, 0x01E4, 0x01E5, 0x006A, 0x0018,
+ 0x03CC, 0x03CD, 0x00D6, 0x000E, 0x009E, 0x009F, 0x00F5, 0x000D,
+ 0x009A, 0x009B, 0x009C, 0x0019, 0x03CE, 0x03CF, 0x00D7, 0x0009,
+ 0x01E8, 0x01E9, 0x0090, 0x000F, 0x00E8, 0x00E9, 0x00F6, 0x0005,
+ 0x00F0, 0x00F1, 0x0037, 0x0010, 0x00EA, 0x00EB, 0x00F7, 0x0011,
+ 0x00EC, 0x00ED, 0x0034, 0x0000, 0x003E, 0x003F, 0x0002
+ },
+ {
+ 0x003C, 0x003D, 0x01CF, 0x0000, 0x00BF, 0x00E0, 0x01FC, 0x0001,
+ 0x00E1, 0x00E2, 0x01FD, 0x0009, 0x01F1, 0x01F2, 0x01F3, 0x0002,
+ 0x00E3, 0x00E4, 0x01FE, 0x0011, 0x03EE, 0x03EF, 0x03F0, 0x0021,
+ 0x07E2, 0x07E3, 0x07E4, 0x0018, 0x03F7, 0x03FE, 0x03FF, 0x0003,
+ 0x00E5, 0x00E6, 0x0080, 0x002E, 0x07E5, 0x07E6, 0x07E7, 0x0016,
+ 0x03F4, 0x03F5, 0x03F6, 0x0019, 0x0102, 0x0103, 0x0104, 0x000A,
+ 0x01F4, 0x01F5, 0x01F6, 0x001A, 0x0105, 0x0106, 0x0107, 0x001B,
+ 0x0178, 0x0179, 0x01CE, 0x001D, 0x00BD, 0x00BE, 0x01F0
+ },
+ {
+ 0x0003, 0x0004, 0x01B6, 0x0004, 0x002E, 0x002F, 0x000E, 0x0005,
+ 0x0030, 0x0031, 0x000F, 0x0003, 0x000A, 0x000B, 0x0014, 0x0006,
+ 0x0032, 0x0033, 0x0010, 0x0005, 0x0030, 0x0031, 0x0032, 0x0009,
+ 0x0066, 0x0067, 0x0068, 0x001D, 0x01B7, 0x01B8, 0x01B9, 0x0007,
+ 0x0034, 0x0035, 0x0011, 0x0016, 0x0069, 0x006A, 0x006B, 0x000A,
+ 0x0036, 0x0037, 0x00D8, 0x001E, 0x01BA, 0x01BB, 0x01BC, 0x0004,
+ 0x0015, 0x0016, 0x0017, 0x001F, 0x01BD, 0x01BE, 0x01BF, 0x0000,
+ 0x0010, 0x0011, 0x0012, 0x001C, 0x00D9, 0x00DA, 0x0013
+ }
+};
+
+static const uint8_t vc1_icbpcy_p_bits[8][63] = {
+ {
+ 15, 15, 14, 9, 11, 11, 13, 9, 11, 11, 12, 8, 9, 9, 9, 9,
+ 11, 11, 12, 9, 10, 10, 10, 10, 11, 11, 11, 8, 8, 8, 7, 9,
+ 11, 11, 12, 10, 11, 11, 11, 9, 10, 10, 10, 8, 8, 8, 7, 8,
+ 9, 9, 9, 8, 8, 8, 7, 8, 8, 8, 7, 3, 3, 3, 1
+ },
+ {
+ 7, 7, 9, 7, 8, 8, 9, 7, 8, 8, 9, 6, 7, 7, 7, 7,
+ 7, 7, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6,
+ 7, 7, 8, 8, 9, 9, 9, 7, 8, 8, 8, 6, 7, 7, 6, 6,
+ 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 4, 3, 2
+ },
+ {
+ 6, 6, 5, 6, 8, 8, 9, 6, 8, 8, 9, 5, 7, 7, 7, 6,
+ 8, 8, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6,
+ 8, 8, 9, 7, 9, 9, 9, 6, 8, 8, 8, 6, 7, 7, 6, 5,
+ 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 5, 4, 2
+ },
+ {
+ 6, 6, 8, 4, 9, 9, 9, 4, 9, 9, 9, 4, 8, 8, 7, 4,
+ 9, 9, 9, 6, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4,
+ 9, 9, 9, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 7, 4,
+ 8, 8, 7, 5, 8, 8, 7, 5, 8, 8, 7, 3, 5, 5, 4
+ },
+ {
+ 6, 6, 5, 5, 7, 7, 7, 5, 7, 7, 7, 5, 6, 6, 6, 5,
+ 7, 7, 7, 6, 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 6, 5,
+ 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 7, 6, 7, 7, 6, 5,
+ 6, 6, 6, 6, 7, 7, 6, 6, 7, 6, 6, 4, 5, 5, 3
+ },
+ {
+ 6, 6, 8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 8, 7, 4,
+ 8, 8, 8, 5, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4,
+ 8, 8, 8, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 8, 4,
+ 8, 8, 7, 5, 8, 8, 8, 5, 8, 8, 7, 3, 6, 6, 4
+ },
+ {
+ 6, 6, 9, 3, 8, 8, 9, 3, 8, 8, 9, 4, 9, 9, 9, 3,
+ 8, 8, 9, 5, 10, 10, 10, 6, 11, 11, 11, 5, 10, 10, 10, 3,
+ 8, 8, 8, 6, 11, 11, 11, 5, 10, 10, 10, 5, 9, 9, 9, 4,
+ 9, 9, 9, 5, 9, 9, 9, 5, 9, 9, 9, 5, 8, 8, 9
+ },
+ {
+ 6, 6, 10, 3, 7, 7, 7, 3, 7, 7, 7, 4, 8, 8, 8, 3,
+ 7, 7, 7, 5, 9, 9, 9, 6, 10, 10, 10, 6, 10, 10, 10, 3,
+ 7, 7, 7, 6, 10, 10, 10, 5, 9, 9, 9, 6, 10, 10, 10, 4,
+ 8, 8, 8, 6, 10, 10, 10, 5, 9, 9, 9, 6, 9, 9, 9
+ }
+};
+
+/* MacroBlock Transform Type: 7.1.3.11, p89
+ * 8x8:B
+ * 8x4:B:btm 8x4:B:top 8x4:B:both,
+ * 4x8:B:right 4x8:B:left 4x8:B:both
+ * 4x4:B 8x8:MB
+ * 8x4:MB:btm 8x4:MB:top 8x4,MB,both
+ * 4x8,MB,right 4x8,MB,left
+ * 4x4,MB */
+static const uint16_t vc1_ttmb_codes[3][16] = {
+ {
+ 0x0003,
+ 0x002E, 0x005F, 0x0000,
+ 0x0016, 0x0015, 0x0001,
+ 0x0004, 0x0014,
+ 0x02F1, 0x0179, 0x017B,
+ 0x0BC0, 0x0BC1, 0x05E1,
+ 0x017A
+ },
+ {
+ 0x0006,
+ 0x0006, 0x0003, 0x0007,
+ 0x000F, 0x000E, 0x0000,
+ 0x0002, 0x0002,
+ 0x0014, 0x0011, 0x000B,
+ 0x0009, 0x0021, 0x0015,
+ 0x0020
+ },
+ {
+ 0x0006,
+ 0x0000, 0x000E, 0x0005,
+ 0x0002, 0x0003, 0x0003,
+ 0x000F, 0x0002,
+ 0x0081, 0x0021, 0x0009,
+ 0x0101, 0x0041, 0x0011,
+ 0x0100
+ }
+};
+
+static const uint8_t vc1_ttmb_bits[3][16] = {
+ {
+ 2,
+ 6, 7, 2,
+ 5, 5, 2,
+ 3, 5,
+ 10, 9, 9,
+ 12, 12, 11,
+ 9
+ },
+ {
+ 3,
+ 4, 4, 4,
+ 4, 4, 3,
+ 3, 2,
+ 7, 7, 6,
+ 6, 8, 7,
+ 8
+ },
+ {
+ 3,
+ 3, 4, 5,
+ 3, 3, 4,
+ 4, 2,
+ 10, 8, 6,
+ 11, 9, 7,
+ 11
+ }
+};
+
+/* TTBLK (Transform Type per Block) tables */
+static const uint8_t vc1_ttblk_codes[3][8] = {
+ { 0, 1, 3, 5, 16, 17, 18, 19 },
+ { 3, 0, 1, 2, 3, 5, 8, 9 },
+ { 1, 0, 1, 4, 6, 7, 10, 11 }
+};
+static const uint8_t vc1_ttblk_bits[3][8] = {
+ { 2, 2, 2, 3, 5, 5, 5, 5 },
+ { 2, 3, 3, 3, 3, 3, 4, 4 },
+ { 2, 3, 3, 3, 3, 3, 4, 4 }
+};
+
+/* SUBBLKPAT tables, p93-94, reordered */
+static const uint8_t vc1_subblkpat_codes[3][15] = {
+ { 14, 12, 7, 11, 9, 26, 2, 10, 27, 8, 0, 6, 1, 15, 1 },
+ { 14, 0, 8, 15, 10, 4, 23, 13, 5, 9, 25, 3, 24, 22, 1 },
+ { 5, 6, 2, 2, 8, 0, 28, 3, 1, 3, 29, 1, 19, 18, 15 }
+};
+static const uint8_t vc1_subblkpat_bits[3][15] = {
+ { 5, 5, 5, 5, 5, 6, 4, 5, 6, 5, 4, 5, 4, 5, 1},
+ { 4, 3, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 2},
+ { 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4}
+};
+
+/* MV differential tables, p265 */
+static const uint16_t vc1_mv_diff_codes[4][73] = {
+ {
+ 0, 2, 3, 8, 576, 3, 2, 6,
+ 5, 577, 578, 7, 8, 9, 40, 19,
+ 37, 82, 21, 22, 23, 579, 580, 166,
+ 96, 167, 49, 194, 195, 581, 582, 583,
+ 292, 293, 294, 13, 2, 7, 24, 50,
+ 102, 295, 13, 7, 8, 18, 50, 103,
+ 38, 20, 21, 22, 39, 204, 103, 23,
+ 24, 25, 104, 410, 105, 106, 107, 108,
+ 109, 220, 411, 442, 222, 443, 446, 447,
+ 7 /* 73 elements */
+ },
+ {
+ 0, 4, 5, 3, 4, 3, 4, 5,
+ 20, 6, 21, 44, 45, 46, 3008, 95,
+ 112, 113, 57, 3009, 3010, 116, 117, 3011,
+ 118, 3012, 3013, 3014, 3015, 3016, 3017, 3018,
+ 3019, 3020, 3021, 3022, 1, 4, 15, 160,
+ 161, 41, 6, 11, 42, 162, 43, 119,
+ 56, 57, 58, 163, 236, 237, 3023, 119,
+ 120, 242, 122, 486, 1512, 487, 246, 494,
+ 1513, 495, 1514, 1515, 1516, 1517, 1518, 1519,
+ 31 /* 73 elements */
+ },
+ {
+ 0, 512, 513, 514, 515, 2, 3, 258,
+ 259, 260, 261, 262, 263, 264, 265, 266,
+ 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278, 279, 280, 281, 282,
+ 283, 284, 285, 286, 1, 5, 287, 288,
+ 289, 290, 6, 7, 291, 292, 293, 294,
+ 295, 296, 297, 298, 299, 300, 301, 302,
+ 303, 304, 305, 306, 307, 308, 309, 310,
+ 311, 312, 313, 314, 315, 316, 317, 318,
+ 319 /* 73 elements */
+ },
+ {
+ 0, 1, 1, 2, 3, 4, 1, 5,
+ 4, 3, 5, 8, 6, 9, 10, 11,
+ 12, 7, 104, 14, 105, 4, 10, 15,
+ 11, 6, 14, 8, 106, 107, 108, 15,
+ 109, 9, 55, 10, 1, 2, 1, 2,
+ 3, 12, 6, 2, 6, 7, 28, 7,
+ 15, 8, 5, 18, 29, 152, 77, 24,
+ 25, 26, 39, 108, 13, 109, 55, 56,
+ 57, 116, 11, 153, 234, 235, 118, 119,
+ 15 /* 73 elements */
+ }
+};
+static const uint8_t vc1_mv_diff_bits[4][73] = {
+ {
+ 6, 7, 7, 8, 14, 6, 5, 6, 7, 14, 14, 6, 6, 6, 8, 9,
+ 10, 9, 7, 7, 7, 14, 14, 10, 9, 10, 8, 10, 10, 14, 14, 14,
+ 13, 13, 13, 6, 3, 5, 6, 8, 9, 13, 5, 4, 4, 5, 7, 9,
+ 6, 5, 5, 5, 6, 9, 8, 5, 5, 5, 7, 10, 7, 7, 7, 7,
+ 7, 8, 10, 9, 8, 9, 9, 9, 3 /* 73 elements */
+ },
+ {
+ 5, 7, 7, 6, 6, 5, 5, 6, 7, 5, 7, 8, 8, 8, 14, 9,
+ 9, 9, 8, 14, 14, 9, 9, 14, 9, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 2, 3, 6, 8, 8, 6, 3, 4, 6, 8, 6, 9,
+ 6, 6, 6, 8, 8, 8, 14, 7, 7, 8, 7, 9, 13, 9, 8, 9,
+ 13, 9, 13, 13, 13, 13, 13, 13, 5 /* 73 elements */
+
+ },
+ {
+ 3, 12, 12, 12, 12, 3, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 1, 5, 11, 11, 11, 11, 4, 4, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11 /* 73 elements */
+ },
+ {
+ 15, 11, 15, 15, 15, 15, 12, 15, 12, 11, 12, 12, 15, 12, 12, 12,
+ 12, 15, 15, 12, 15, 10, 11, 12, 11, 10, 11, 10, 15, 15, 15, 11,
+ 15, 10, 14, 10, 4, 4, 5, 7, 8, 9, 5, 3, 4, 5, 6, 8,
+ 5, 4, 3, 5, 6, 8, 7, 5, 5, 5, 6, 7, 9, 7, 6, 6,
+ 6, 7, 10, 8, 8, 8, 7, 7, 4 /* 73 elements */
+ }
+};
+
+const int ff_vc1_ac_sizes[AC_MODES] = {
+ 186, 169, 133, 149, 103, 103, 163, 175
+};
+
+#endif /* AVCODEC_VC1_VLC_DATA_H */
diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c
index 004b1347d4..5ebf20a0f0 100644
--- a/libavcodec/vc1data.c
+++ b/libavcodec/vc1data.c
@@ -170,811 +170,11 @@ const AVRational ff_vc1_pixel_aspect[16] = {
{ 0, 1 }
};
-/* BitPlane IMODE - such a small table... */
-const uint8_t ff_vc1_imode_codes[7] = {
- 0, 2, 1, 3, 1, 2, 3
-};
-const uint8_t ff_vc1_imode_bits[7] = {
- 4, 2, 3, 2, 4, 3, 3
-};
-
-/* Normal-2 imode */
-const uint8_t ff_vc1_norm2_codes[4] = {
- 0, 4, 5, 3
-};
-const uint8_t ff_vc1_norm2_bits[4] = {
- 1, 3, 3, 2
-};
-
-const uint16_t ff_vc1_norm6_codes[64] = {
- 0x001, 0x002, 0x003, 0x000, 0x004, 0x001, 0x002, 0x047, 0x005, 0x003, 0x004, 0x04B, 0x005, 0x04D, 0x04E, 0x30E,
- 0x006, 0x006, 0x007, 0x053, 0x008, 0x055, 0x056, 0x30D, 0x009, 0x059, 0x05A, 0x30C, 0x05C, 0x30B, 0x30A, 0x037,
- 0x007, 0x00A, 0x00B, 0x043, 0x00C, 0x045, 0x046, 0x309, 0x00D, 0x049, 0x04A, 0x308, 0x04C, 0x307, 0x306, 0x036,
- 0x00E, 0x051, 0x052, 0x305, 0x054, 0x304, 0x303, 0x035, 0x058, 0x302, 0x301, 0x034, 0x300, 0x033, 0x032, 0x007,
-};
-
-const uint8_t ff_vc1_norm6_bits[64] = {
- 1, 4, 4, 8, 4, 8, 8, 10, 4, 8, 8, 10, 8, 10, 10, 13,
- 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9,
- 4, 8, 8, 10, 8, 10, 10, 13, 8, 10, 10, 13, 10, 13, 13, 9,
- 8, 10, 10, 13, 10, 13, 13, 9, 10, 13, 13, 9, 13, 9, 9, 6,
-};
-
-/* 4MV Block pattern VLC tables */
-const uint8_t ff_vc1_4mv_block_pattern_codes[4][16] = {
- { 14, 58, 59, 25, 12, 26, 15, 15, 13, 24, 27, 0, 28, 1, 2, 2 },
- { 8, 18, 19, 4, 20, 5, 30, 11, 21, 31, 6, 12, 7, 13, 14, 0 },
- { 15, 6, 7, 2, 8, 3, 28, 9, 10, 29, 4, 11, 5, 12, 13, 0 },
- { 0, 11, 12, 4, 13, 5, 30, 16, 14, 31, 6, 17, 7, 18, 19, 10 }
-};
-const uint8_t ff_vc1_4mv_block_pattern_bits[4][16] = {
- { 5, 6, 6, 5, 5, 5, 5, 4, 5, 5, 5, 3, 5, 3, 3, 2 },
- { 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4, 4, 4, 4, 4, 2 },
- { 4, 4, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 4, 3 },
- { 2, 4, 4, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4 }
-};
-
-/* 2MV Block pattern VLC tables */
-const uint8_t ff_vc1_2mv_block_pattern_codes[4][4] = {
- { 2, 1, 0, 3 }, { 1, 0, 2, 3 }, { 2, 0, 3, 1 }, { 1, 3, 2, 0 }
-};
-
-const uint8_t ff_vc1_2mv_block_pattern_bits[4][4] = {
- { 2, 2, 2, 2 }, { 1, 2, 3, 3 }, { 3, 2, 3, 1 }, { 1, 3, 3, 2 }
-};
-
-/* Interlaced frame picture 4MV MBMODE VLC tables (p. 246, p. 360) */
-const uint16_t ff_vc1_intfr_4mv_mbmode_codes[4][15] = {
- { 22, 17, 0, 47, 32, 10, 1, 3, 67, 133, 132, 92, 19, 93, 18 },
- { 3, 45, 0, 7, 23, 6, 1, 2, 10, 39, 44, 8, 18, 77, 76 },
- { 15, 6, 28, 9, 41, 6, 2, 15, 14, 8, 40, 29, 0, 21, 11 },
- { 7, 198, 1, 2, 193, 13, 25, 0, 97, 1599, 98, 398, 798, 192, 1598 }
-};
-
-const uint8_t ff_vc1_intfr_4mv_mbmode_bits[4][15] = {
- { 5, 5, 2, 6, 6, 4, 2, 2, 7, 8, 8, 7, 5, 7, 5 },
- { 3, 6, 3, 3, 5, 3, 3, 3, 4, 6, 6, 4, 5, 7, 7 },
- { 4, 3, 5, 5, 7, 4, 2, 5, 5, 5, 7, 5, 2, 6, 5 },
- { 4, 9, 1, 3, 9, 5, 6, 2, 8, 12, 8, 10, 11, 9, 12 }
-};
-
-/* Interlaced frame picture NON-4MV MBMODE VLC tables (p. 363) */
-const uint8_t ff_vc1_intfr_non4mv_mbmode_codes[4][9] = {
- { 9, 22, 0, 17, 16, 10, 1, 3, 23 },
- { 7, 0, 5, 2, 1, 1, 6, 3, 4 },
- { 1, 0, 10, 23, 44, 8, 3, 9, 45 },
- { 7, 97, 1, 2, 49, 13, 25, 0, 96 }
-};
-
-const uint8_t ff_vc1_intfr_non4mv_mbmode_bits[4][9] = {
- { 4, 5, 2, 5, 5, 4, 2, 2, 5 },
- { 3, 4, 6, 2, 3, 2, 3, 5, 6 },
- { 2, 2, 4, 5, 6, 4, 2, 4, 6 },
- { 4, 8, 1, 3, 7, 5, 6, 2, 8 }
-};
-
-/* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */
-/* mixed-MV */
-const uint8_t ff_vc1_if_mmv_mbmode_codes[8][8] = {
- { 16, 17, 3, 3, 0, 5, 9, 2 },
- { 8, 9, 3, 6, 7, 0, 5, 2 },
- { 16, 17, 5, 3, 0, 3, 9, 2 },
- { 56, 57, 15, 4, 5, 6, 29, 0 },
- { 52, 53, 27, 14, 15, 2, 12, 0 },
- { 56, 57, 29, 5, 6, 0, 15, 4 },
- { 16, 17, 6, 7, 0, 1, 9, 5 },
- { 56, 57, 0, 5, 6, 29, 4, 15 }
-};
-const uint8_t ff_vc1_if_mmv_mbmode_bits[8][8] = {
- { 6, 6, 2, 3, 2, 4, 5, 2 },
- { 5, 5, 3, 3, 3, 2, 4, 2 },
- { 6, 6, 4, 3, 2, 2, 5, 2 },
- { 6, 6, 4, 3, 3, 3, 5, 1 },
- { 6, 6, 5, 4, 4, 2, 4, 1 },
- { 6, 6, 5, 3, 3, 1, 4, 3 },
- { 5, 5, 3, 3, 2, 2, 4, 3 },
- { 6, 6, 1, 3, 3, 5, 3, 4 }
-};
-/* 1MV */
-const uint8_t ff_vc1_if_1mv_mbmode_codes[8][6] = {
- { 0, 1, 1, 1, 1, 1 },
- { 0, 1, 1, 1, 1, 1 },
- { 16, 17, 3, 0, 9, 5 },
- { 20, 21, 3, 11, 0, 4 },
- { 4, 5, 2, 3, 3, 0 },
- { 4, 5, 3, 2, 0, 3 },
- { 0, 1, 1, 1, 1, 1 },
- { 16, 17, 9, 5, 3, 0 }
-};
-const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6] = {
- { 5, 5, 1, 3, 2, 4 },
- { 5, 5, 1, 2, 3, 4 },
- { 5, 5, 2, 1, 4, 3 },
- { 5, 5, 2, 4, 1, 3 },
- { 4, 4, 2, 3, 2, 2 },
- { 4, 4, 3, 2, 2, 2 },
- { 5, 5, 3, 4, 1, 2 },
- { 5, 5, 4, 3, 2, 1 }
-};
-
-/* Interlaced frame/field picture MVDATA VLC tables */
-
-/* 1-reference tables */
-const uint32_t ff_vc1_1ref_mvdata_codes[4][72] = { /* uint32_t may be too big */
- {
- 0x00005, 0x0000C, 0x0001E, 0x00012, 0x0000C, 0x00034, 0x00075, 0x00070,
- 0x00000, 0x00008, 0x0001B, 0x00008, 0x0001D, 0x0007C, 0x000D6, 0x001DE,
- 0x001AF, 0x00005, 0x0001B, 0x00026, 0x0001E, 0x00012, 0x00076, 0x0004D,
- 0x001F6, 0x001F4, 0x00039, 0x0007F, 0x00027, 0x0006A, 0x00071, 0x00035,
- 0x00071, 0x00068, 0x001DC, 0x00027, 0x00073, 0x000FF, 0x000E8, 0x000E9,
- 0x0007E, 0x001F9, 0x001F5, 0x001FD, 0x0003E, 0x001CA, 0x003F9, 0x0004C,
- 0x00069, 0x001FA, 0x001DF, 0x001F7, 0x00070, 0x001DD, 0x00E4D, 0x00727,
- 0x00392, 0x001C8, 0x001CB, 0x003F8, 0x001AE, 0x001F8, 0x001FB, 0x0E4CE,
- 0x0E4CF, 0x07260, 0x07261, 0x07262, 0x07263, 0x07264, 0x07265, 0x07266
- },
- {
- 0x00007, 0x00001, 0x00007, 0x00016, 0x00001, 0x00045, 0x00018, 0x002B6,
- 0x00006, 0x00004, 0x00017, 0x00010, 0x00029, 0x0002C, 0x0015A, 0x00066,
- 0x0019E, 0x00009, 0x00028, 0x00017, 0x00000, 0x0002A, 0x00004, 0x0005B,
- 0x000B5, 0x000CE, 0x00006, 0x00044, 0x0000F, 0x00046, 0x0000E, 0x000AC,
- 0x00032, 0x00037, 0x011EB, 0x0000A, 0x0001A, 0x0011F, 0x00016, 0x00014,
- 0x0002B, 0x00168, 0x00055, 0x023D5, 0x00057, 0x0002F, 0x00036, 0x0002E,
- 0x00169, 0x00054, 0x0047B, 0x0019F, 0x02B7D, 0x0008E, 0x00ADE, 0x00479,
- 0x0056E, 0x008F4, 0x015BF, 0x00478, 0x023D4, 0x0ADF1, 0x056F9, 0xADF0E,
- 0xADF0F, 0x56F80, 0x56F81, 0x56F82, 0x56F83, 0x56F84, 0x56F85, 0x56F86
- },
- {
- 0x00002, 0x00006, 0x00007, 0x0000D, 0x00007, 0x00030, 0x000FF, 0x001F0,
- 0x00002, 0x00000, 0x00005, 0x00019, 0x0001E, 0x00007, 0x00063, 0x000FD,
- 0x00023, 0x0000E, 0x0001B, 0x0001A, 0x00006, 0x00009, 0x00018, 0x000C5,
- 0x00033, 0x001F1, 0x00002, 0x003FB, 0x001F3, 0x00022, 0x001FC, 0x00042,
- 0x00623, 0x00083, 0x00620, 0x0007D, 0x00040, 0x00043, 0x003E4, 0x003E5,
- 0x00191, 0x00FE9, 0x00105, 0x00208, 0x000FC, 0x00624, 0x00622, 0x00190,
- 0x00626, 0x007F5, 0x00C4B, 0x01FD0, 0x0104D, 0x00065, 0x00C42, 0x000C9,
- 0x00627, 0x00C43, 0x00C4A, 0x0104E, 0x01FD1, 0x0104F, 0x00412, 0x104CE,
- 0x104CF, 0x08260, 0x08261, 0x08262, 0x08263, 0x08264, 0x08265, 0x08266
- },
- {
- 0x0000D, 0x00001, 0x00004, 0x00000, 0x00017, 0x00005, 0x0007F, 0x0004D,
- 0x00003, 0x00011, 0x0003E, 0x0003B, 0x00017, 0x00067, 0x0004A, 0x000C3,
- 0x000F2, 0x0000A, 0x0002C, 0x00032, 0x0003D, 0x00015, 0x00028, 0x00093,
- 0x000CC, 0x00096, 0x00003, 0x00075, 0x00020, 0x0002D, 0x00021, 0x00029,
- 0x00090, 0x001D0, 0x001FB, 0x0001C, 0x0004C, 0x00060, 0x00009, 0x00008,
- 0x0002D, 0x0009F, 0x001FA, 0x0013D, 0x00031, 0x000FC, 0x00058, 0x00092,
- 0x000F0, 0x000F1, 0x000CD, 0x00185, 0x00165, 0x0004E, 0x00091, 0x000E9,
- 0x00184, 0x001D1, 0x001E6, 0x00097, 0x001E7, 0x000B3, 0x0013C, 0x0164E,
- 0x0164F, 0x00B20, 0x00B21, 0x00B22, 0x00B23, 0x00B24, 0x00B25, 0x00B26
- }
-};
-
-const uint8_t ff_vc1_1ref_mvdata_bits[4][72] = {
- {
- 3, 4, 5, 5, 5, 6, 7, 7, 2, 4, 5, 5, 6, 7, 8, 9, 9, 4,
- 6, 6, 6, 6, 7, 8, 9, 9, 6, 8, 7, 7, 7, 7, 8, 8, 9, 6,
- 8, 8, 8, 8, 8, 9, 9, 9, 7, 10, 10, 8, 8, 9, 9, 9, 8, 9,
- 13, 12, 11, 10, 10, 10, 9, 9, 9, 17, 17, 16, 16, 16, 16, 16, 16, 16
- },
- {
- 3, 3, 4, 5, 5, 7, 8, 10, 3, 4, 5, 5, 6, 7, 9, 10, 12, 4,
- 6, 6, 5, 6, 6, 8, 9, 11, 4, 7, 7, 7, 7, 8, 9, 9, 13, 5,
- 8, 9, 8, 8, 9, 10, 10, 14, 7, 9, 9, 9, 10, 10, 11, 12, 14, 8,
- 12, 11, 11, 12, 13, 11, 14, 16, 15, 20, 20, 19, 19, 19, 19, 19, 19, 19
- },
- {
- 3, 4, 4, 4, 5, 6, 8, 9, 2, 4, 5, 5, 5, 6, 7, 8, 8, 4,
- 7, 7, 6, 6, 7, 8, 8, 9, 5, 10, 9, 8, 9, 9, 11, 10, 11, 7,
- 9, 9, 10, 10, 11, 12, 11, 12, 8, 11, 11, 11, 11, 11, 12, 13, 15, 9,
- 12, 10, 11, 12, 12, 15, 13, 15, 13, 19, 19, 18, 18, 18, 18, 18, 18, 18
- },
- {
- 4, 4, 4, 4, 5, 5, 7, 7, 3, 5, 6, 6, 6, 7, 7, 8, 8, 4,
- 6, 6, 6, 6, 7, 8, 8, 8, 4, 7, 6, 6, 6, 7, 8, 9, 9, 5,
- 7, 7, 6, 6, 7, 8, 9, 9, 6, 8, 8, 8, 8, 8, 8, 9, 10, 7,
- 8, 8, 9, 9, 9, 8, 9, 9, 9, 14, 14, 13, 13, 13, 13, 13, 13, 13
- }
-};
-
-/* 2-reference tables */
-const uint32_t ff_vc1_2ref_mvdata_codes[8][126] = { /* table 132 - table 139 */
- {
- 0x0000C, 0x0001C, 0x0000B, 0x00000, 0x0000E, 0x0002A, 0x00050, 0x00368,
- 0x00002, 0x0001A, 0x00004, 0x0003A, 0x0001D, 0x0006C, 0x000EF, 0x001BC,
- 0x0015F, 0x0000F, 0x00003, 0x0001C, 0x0000D, 0x0000B, 0x0003E, 0x000A7,
- 0x00146, 0x00199, 0x00006, 0x0001F, 0x00004, 0x0003C, 0x00007, 0x001BE,
- 0x0008B, 0x0002C, 0x007B3, 0x00005, 0x000DB, 0x00056, 0x000EC, 0x00052,
- 0x001BD, 0x00078, 0x000CF, 0x00573, 0x00009, 0x00023, 0x000ED, 0x00018,
- 0x00006, 0x00044, 0x000F5, 0x00079, 0x006D2, 0x0006E, 0x0002B, 0x0015D,
- 0x00017, 0x0037F, 0x00144, 0x000CE, 0x00028, 0x000AB, 0x00010, 0x001B5,
- 0x000F7, 0x000A6, 0x0007B, 0x00028, 0x001ED, 0x001E9, 0x006FD, 0x00004,
- 0x000F5, 0x00029, 0x0028A, 0x0028B, 0x0028F, 0x00DF9, 0x00335, 0x01E85,
- 0x000EE, 0x002BD, 0x0002B, 0x003D8, 0x003D1, 0x00198, 0x001E9, 0x0051D,
- 0x000B4, 0x0003F, 0x00455, 0x0022B, 0x00229, 0x00451, 0x00578, 0x007B2,
- 0x00570, 0x00155, 0x00032, 0x003D0, 0x00054, 0x006D3, 0x00571, 0x00454,
- 0x00334, 0x01BF1, 0x000B7, 0x00029, 0x01E84, 0x0016C, 0x0019B, 0x01BF0,
- 0x00579, 0x00F43, 0x000B5, 0x008A1, 0x0002A, 0x0016D, 0x008A0, 0x007A0,
- 0x003D1, 0x00AE5, 0x00154, 0x00AE4, 0x00A39, 0x00A38
- },
- {
- 0x00003, 0x00009, 0x00016, 0x00010, 0x000D7, 0x00335, 0x00574, 0x00555,
- 0x00000, 0x0001D, 0x00009, 0x00017, 0x0002C, 0x000AD, 0x00374, 0x006B3,
- 0x00577, 0x0000F, 0x00018, 0x0000A, 0x0002E, 0x00022, 0x0017C, 0x00E7B,
- 0x01B89, 0x015D8, 0x00008, 0x00034, 0x0006D, 0x00023, 0x001C2, 0x00376,
- 0x002D3, 0x01C4A, 0x0330A, 0x00014, 0x0006A, 0x00072, 0x0006C, 0x000E3,
- 0x0019B, 0x0073F, 0x01CF0, 0x00B41, 0x00032, 0x000E6, 0x000E0, 0x000CF,
- 0x000AB, 0x0019C, 0x002AB, 0x00E2B, 0x015D9, 0x0006F, 0x001C3, 0x000AF,
- 0x000BF, 0x000AC, 0x0017D, 0x006E3, 0x00E29, 0x01984, 0x00054, 0x000B5,
- 0x0017A, 0x001AD, 0x00199, 0x00178, 0x00358, 0x002D2, 0x01C4B, 0x0005B,
- 0x002A8, 0x00331, 0x00388, 0x0038B, 0x00370, 0x00713, 0x00CC3, 0x01CF1,
- 0x001B9, 0x005EF, 0x00738, 0x002F2, 0x0033B, 0x002B9, 0x006EB, 0x00570,
- 0x00E24, 0x0039D, 0x005A2, 0x005A3, 0x00E7D, 0x005EE, 0x00739, 0x00554,
- 0x00AA5, 0x00AA4, 0x00377, 0x01CF5, 0x00BCE, 0x00E79, 0x00660, 0x00674,
- 0x006EA, 0x00E7C, 0x00D65, 0x002F6, 0x015DA, 0x01B88, 0x005A1, 0x01CF4,
- 0x005E6, 0x00E28, 0x00575, 0x00D64, 0x00334, 0x0330B, 0x015DB, 0x00B40,
- 0x00BCF, 0x00DC5, 0x00E2A, 0x00675, 0x00571, 0x00553
- },
- {
- 0x00004, 0x00002, 0x00010, 0x00003, 0x00017, 0x00045, 0x0003E, 0x0007E,
- 0x00003, 0x00002, 0x00028, 0x0001E, 0x00015, 0x00047, 0x00002, 0x0014D,
- 0x00060, 0x0000B, 0x00026, 0x00024, 0x00014, 0x00032, 0x0006F, 0x000C3,
- 0x00531, 0x006E5, 0x00015, 0x0003F, 0x0002D, 0x00001, 0x0013E, 0x000DD,
- 0x000F6, 0x00305, 0x00331, 0x0000E, 0x00003, 0x00034, 0x00033, 0x0001A,
- 0x0014A, 0x000C5, 0x000F4, 0x006E4, 0x00001, 0x0003C, 0x0007D, 0x0008D,
- 0x0009D, 0x00031, 0x0006E, 0x00296, 0x000CD, 0x00025, 0x00149, 0x00032,
- 0x00089, 0x00036, 0x00088, 0x0006F, 0x00003, 0x0031D, 0x0000E, 0x001AA,
- 0x0027E, 0x00061, 0x0014E, 0x0014F, 0x00067, 0x000FF, 0x00183, 0x00036,
- 0x00357, 0x000F5, 0x000C6, 0x000C2, 0x00299, 0x00119, 0x00231, 0x00350,
- 0x0002C, 0x0018F, 0x00530, 0x00297, 0x00004, 0x001B8, 0x000C0, 0x0027A,
- 0x00311, 0x0009C, 0x00621, 0x00199, 0x0031C, 0x000F7, 0x003E3, 0x00356,
- 0x00189, 0x00005, 0x0006B, 0x008C2, 0x00330, 0x004FF, 0x004F0, 0x00351,
- 0x004F2, 0x001F2, 0x00373, 0x00000, 0x00C41, 0x008C3, 0x009EC, 0x003E2,
- 0x00304, 0x004F7, 0x004F1, 0x001F0, 0x00148, 0x00C40, 0x009ED, 0x008C0,
- 0x008C1, 0x004F3, 0x004FE, 0x000FE, 0x001F3, 0x001A9
- },
- {
- 0x00000, 0x00004, 0x0002F, 0x00052, 0x00010, 0x000AD, 0x0050B, 0x00190,
- 0x00003, 0x00016, 0x00007, 0x0000D, 0x000BB, 0x00173, 0x000C9, 0x0050F,
- 0x0172C, 0x00003, 0x00011, 0x00005, 0x00043, 0x00023, 0x0004B, 0x0032E,
- 0x02E5B, 0x00482, 0x00009, 0x0002A, 0x00014, 0x0002A, 0x00108, 0x005CA,
- 0x0065A, 0x02136, 0x02132, 0x0000B, 0x00013, 0x00041, 0x000B8, 0x00174,
- 0x00100, 0x014DA, 0x0404E, 0x01437, 0x0002B, 0x00085, 0x000A7, 0x000A0,
- 0x0014C, 0x0029A, 0x0032C, 0x02133, 0x0142A, 0x00051, 0x00284, 0x000AC,
- 0x00102, 0x00045, 0x00044, 0x0081B, 0x0065E, 0x00CB7, 0x00018, 0x0050C,
- 0x00212, 0x002E4, 0x00203, 0x00094, 0x00122, 0x0081A, 0x00655, 0x00033,
- 0x002BA, 0x00246, 0x00242, 0x00A6E, 0x0040C, 0x00808, 0x02134, 0x0404F,
- 0x00175, 0x00405, 0x00247, 0x0012A, 0x00A14, 0x002BB, 0x00191, 0x0084F,
- 0x01438, 0x000AF, 0x00B97, 0x00483, 0x0143B, 0x0032B, 0x00243, 0x0142B,
- 0x00958, 0x029BF, 0x00049, 0x00A6C, 0x014DB, 0x004AD, 0x014DE, 0x0084E,
- 0x01434, 0x00257, 0x02E5A, 0x00207, 0x01435, 0x01439, 0x00CB6, 0x0143A,
- 0x00194, 0x00654, 0x02135, 0x0537C, 0x0015C, 0x00240, 0x01012, 0x0537D,
- 0x00959, 0x01098, 0x01436, 0x0065F, 0x02026, 0x02137
- },
- {
- 0x00005, 0x00019, 0x00016, 0x00011, 0x0003E, 0x0005E, 0x000EF, 0x000E2,
- 0x00000, 0x00039, 0x0002B, 0x00026, 0x00028, 0x00012, 0x000C2, 0x000ED,
- 0x0011D, 0x0000D, 0x00031, 0x0002A, 0x00025, 0x00020, 0x0005C, 0x001ED,
- 0x0024D, 0x00770, 0x00006, 0x0007A, 0x00060, 0x0004F, 0x00048, 0x00039,
- 0x00186, 0x00213, 0x00EC6, 0x0000F, 0x00026, 0x0005F, 0x00075, 0x00070,
- 0x00027, 0x001DB, 0x003C6, 0x0078F, 0x0003F, 0x000A6, 0x000F0, 0x0003A,
- 0x00052, 0x0004E, 0x000E3, 0x001D9, 0x0030F, 0x00010, 0x001DD, 0x000A7,
- 0x000F7, 0x00022, 0x00092, 0x003C4, 0x002EF, 0x00762, 0x00079, 0x0008F,
- 0x001DA, 0x00087, 0x000E8, 0x000BA, 0x00176, 0x000EE, 0x003B0, 0x00085,
- 0x00119, 0x0030E, 0x00108, 0x001D2, 0x0010C, 0x00773, 0x00424, 0x00434,
- 0x00071, 0x005DD, 0x001C1, 0x003A7, 0x00127, 0x0008D, 0x0021B, 0x007B2,
- 0x001DF, 0x003D8, 0x00764, 0x00EE4, 0x003B3, 0x0074D, 0x001D8, 0x005DC,
- 0x0084A, 0x00499, 0x003C5, 0x01D8E, 0x00765, 0x00435, 0x00771, 0x001C2,
- 0x00118, 0x003BC, 0x00381, 0x00387, 0x07B33, 0x01097, 0x01096, 0x01ECD,
- 0x00E99, 0x00F1C, 0x00F1D, 0x00EE5, 0x0011C, 0x07B32, 0x03D98, 0x01D8F,
- 0x00E98, 0x00F67, 0x003BD, 0x00380, 0x00498, 0x00386
- },
- {
- 0x0000D, 0x00010, 0x0002E, 0x00039, 0x0000D, 0x00074, 0x000ED, 0x000B6,
- 0x00001, 0x00002, 0x00000, 0x00030, 0x00029, 0x00070, 0x000F3, 0x0008C,
- 0x00166, 0x00009, 0x00033, 0x00078, 0x00006, 0x000C4, 0x0000B, 0x00163,
- 0x000CC, 0x005BE, 0x0001F, 0x0002F, 0x00064, 0x00018, 0x000C6, 0x0000A,
- 0x00162, 0x002C0, 0x00EF3, 0x00007, 0x0000F, 0x000E3, 0x000CA, 0x000B2,
- 0x0018F, 0x003AE, 0x0075F, 0x00C51, 0x00015, 0x00047, 0x000EE, 0x000E2,
- 0x000EA, 0x00009, 0x0016A, 0x002C3, 0x0059D, 0x0003D, 0x00008, 0x001D9,
- 0x00032, 0x0000E, 0x0016E, 0x0032C, 0x0065B, 0x0196B, 0x00002, 0x0000F,
- 0x001D8, 0x0008D, 0x000B4, 0x001E4, 0x00067, 0x00317, 0x00794, 0x00022,
- 0x003BE, 0x00315, 0x00034, 0x00037, 0x002DE, 0x0006C, 0x00EFE, 0x0066C,
- 0x00028, 0x003CB, 0x003AC, 0x00035, 0x0016B, 0x003BD, 0x002C1, 0x0062C,
- 0x01DFE, 0x0000E, 0x0059E, 0x005BF, 0x000DA, 0x00629, 0x00584, 0x00EB7,
- 0x00B0A, 0x0066D, 0x0000C, 0x0077E, 0x0059C, 0x00778, 0x0075E, 0x0075A,
- 0x0062D, 0x00337, 0x00334, 0x00197, 0x01E57, 0x01DE4, 0x0196A, 0x01E56,
- 0x00C50, 0x00B3F, 0x01E54, 0x00B0B, 0x0018E, 0x001B6, 0x01E55, 0x00CB4,
- 0x00B3E, 0x00EB6, 0x01DE5, 0x01DFF, 0x00335, 0x001B7
- },
- {
- 0x00001, 0x0000B, 0x00019, 0x0006F, 0x0002A, 0x00075, 0x007EB, 0x00163,
- 0x00001, 0x0000E, 0x0001A, 0x0003E, 0x0001C, 0x0002D, 0x00164, 0x007EC,
- 0x00165, 0x00004, 0x00006, 0x00036, 0x0007F, 0x000AE, 0x00158, 0x0015C,
- 0x0056D, 0xFD510, 0x00000, 0x00004, 0x0007B, 0x000F3, 0x0003B, 0x007ED,
- 0x002B3, 0x002CC, 0x0056E, 0x00018, 0x0003E, 0x00017, 0x0001E, 0x000AF,
- 0x003F7, 0x0056F, 0x002CD, 0xFD511, 0x00014, 0x000AD, 0x000AA, 0x00014,
- 0x000A8, 0x00153, 0x000E8, 0x001FE, 0x00DCF, 0x00078, 0x001B8, 0x00152,
- 0x000FE, 0x002B1, 0x0015D, 0x00160, 0xFD512, 0xFD513, 0x0007A, 0x002B0,
- 0x001E5, 0x000E9, 0x000FC, 0x006E6, 0x00DC8, 0x00584, 0xFD514, 0x000AB,
- 0x00DDE, 0x00159, 0x003F4, 0x00DC9, 0x00DCA, 0x001FA, 0xFD515, 0xFD516,
- 0x000FC, 0x001FF, 0x001E4, 0x000AF, 0x0015A, 0x00167, 0x00DCB, 0x00585,
- 0xFD517, 0x003F7, 0x03F55, 0xFD518, 0x00DDC, 0x00586, 0x03F56, 0xFD519,
- 0x03F57, 0xFD51A, 0x001BA, 0x00587, 0x00588, 0x00DDF, 0x002B2, 0xFD51B,
- 0x00DCE, 0x003F6, 0xFD51C, 0x00FD4, 0xFD51D, 0xFD51E, 0xFD51F, 0x7EA80,
- 0x7EA81, 0x0056C, 0x7EA82, 0x7EA83, 0x00376, 0x00589, 0x0058A, 0x7EA84,
- 0x7EA85, 0x00DDD, 0x7EA86, 0x7EA87, 0x0058B, 0x07EA9
- },
- {
- 0x00003, 0x0000E, 0x0000F, 0x0007E, 0x00062, 0x000C6, 0x00CD9, 0x0063E,
- 0x00002, 0x00002, 0x00000, 0x00018, 0x0000C, 0x00069, 0x00039, 0x00707,
- 0x00C7E, 0x00002, 0x0000D, 0x0001B, 0x0000F, 0x0019A, 0x00647, 0x01A37,
- 0x346C4, 0x0346D, 0x00001, 0x0001E, 0x0007F, 0x0000A, 0x000E1, 0x00661,
- 0x00CE4, 0x346C5, 0x346C6, 0x0001D, 0x00030, 0x0000D, 0x000CB, 0x00199,
- 0x00320, 0x0008E, 0x0652E, 0x346C7, 0x0003E, 0x00039, 0x00035, 0x00033,
- 0x0019F, 0x001C0, 0x00CDA, 0x346C8, 0x346C9, 0x0000B, 0x000D0, 0x0019E,
- 0x00022, 0x00038, 0x0018E, 0x0031E, 0x03294, 0x0023C, 0x00032, 0x00012,
- 0x00013, 0x00071, 0x0019D, 0x00020, 0x00C87, 0x00CC0, 0x346CA, 0x00338,
- 0x00653, 0x001A2, 0x0032A, 0x00322, 0x00CE7, 0x00084, 0x0011F, 0x346CB,
- 0x00325, 0x00649, 0x0032B, 0x00077, 0x00648, 0x00642, 0x00C86, 0x00C8C,
- 0x346CC, 0x0003A, 0x019B7, 0x00043, 0x00327, 0x0008C, 0x0008D, 0x00C8D,
- 0x346CD, 0x346CE, 0x00337, 0x00CE5, 0x00085, 0x00326, 0x00347, 0x00CA4,
- 0x00C7F, 0x00D1A, 0x346CF, 0x00328, 0x1A360, 0x1A361, 0x00CD8, 0x0068C,
- 0x03295, 0x03296, 0x0652F, 0x066D8, 0x00331, 0x00706, 0x0023D, 0x00076,
- 0x00CC1, 0x00382, 0x00CE6, 0x066D9, 0x066DA, 0x066DB
- }
-};
-
-const uint8_t ff_vc1_2ref_mvdata_bits[8][126] = {
- {
- 4, 5, 5, 5, 6, 7, 8, 10, 2, 5, 5, 6, 6, 7, 8, 9,
- 10, 4, 5, 6, 6, 7, 8, 9, 10, 11, 4, 6, 6, 7, 7, 9,
- 9, 10, 12, 5, 8, 8, 8, 8, 9, 9, 10, 12, 5, 7, 8, 7,
- 7, 8, 9, 9, 11, 7, 9, 10, 9, 10, 10, 10, 10, 12, 6, 9,
- 9, 9, 9, 9, 10, 10, 11, 7, 10, 10, 11, 11, 11, 12, 12, 14,
- 8, 11, 10, 11, 11, 11, 11, 12, 12, 8, 12, 11, 11, 12, 12, 12,
- 12, 13, 8, 12, 11, 11, 12, 12, 12, 13, 12, 9, 14, 13, 11, 13,
- 12, 13, 12, 13, 9, 13, 13, 12, 12, 13, 13, 13, 13, 13
- },
- {
- 3, 4, 5, 6, 8, 10, 11, 11, 2, 5, 5, 6, 7, 8, 10, 11,
- 11, 4, 5, 5, 6, 7, 9, 12, 13, 13, 4, 6, 7, 7, 9, 10,
- 11, 13, 14, 5, 7, 7, 7, 8, 9, 11, 13, 13, 6, 8, 8, 8,
- 8, 9, 10, 12, 13, 7, 9, 8, 8, 8, 9, 11, 12, 13, 7, 9,
- 9, 9, 9, 9, 10, 11, 13, 8, 10, 10, 10, 10, 10, 11, 12, 13,
- 9, 11, 11, 10, 10, 10, 11, 11, 12, 10, 12, 12, 12, 11, 11, 11,
- 12, 12, 10, 13, 12, 12, 11, 11, 11, 12, 12, 10, 13, 13, 12, 13,
- 11, 12, 11, 12, 10, 14, 13, 13, 12, 12, 12, 11, 11, 11
- },
- {
- 4, 4, 5, 5, 6, 7, 8, 9, 2, 5, 6, 6, 6, 7, 7, 9,
- 9, 4, 6, 6, 6, 7, 8, 9, 11, 12, 5, 7, 7, 7, 9, 9,
- 10, 11, 12, 5, 7, 7, 7, 7, 9, 9, 10, 12, 5, 8, 8, 8,
- 8, 8, 9, 10, 10, 6, 9, 8, 8, 8, 8, 9, 9, 11, 6, 10,
- 10, 9, 9, 9, 9, 10, 10, 7, 11, 10, 9, 9, 10, 9, 10, 11,
- 7, 10, 11, 10, 10, 10, 9, 10, 11, 8, 12, 11, 11, 10, 11, 11,
- 10, 10, 8, 12, 12, 11, 11, 11, 11, 10, 11, 8, 13, 12, 12, 11,
- 11, 11, 11, 10, 9, 13, 12, 12, 12, 11, 11, 10, 10, 10
- },
- {
- 3, 4, 6, 7, 7, 9, 11, 11, 2, 5, 5, 6, 8, 9, 10, 11,
- 13, 3, 5, 5, 7, 8, 9, 12, 14, 13, 4, 6, 6, 7, 9, 11,
- 13, 14, 14, 5, 7, 7, 8, 9, 9, 13, 15, 13, 6, 8, 8, 8,
- 9, 10, 12, 14, 13, 7, 10, 9, 9, 9, 9, 12, 13, 14, 7, 11,
- 10, 10, 10, 10, 11, 12, 13, 8, 11, 12, 12, 12, 11, 12, 14, 15,
- 9, 11, 12, 11, 12, 11, 11, 12, 13, 9, 12, 13, 13, 12, 12, 13,
- 14, 14, 9, 12, 13, 13, 13, 12, 13, 12, 14, 10, 13, 13, 14, 13,
- 11, 13, 14, 15, 10, 12, 13, 15, 14, 13, 13, 13, 14, 14
- },
- {
- 4, 5, 5, 5, 6, 7, 8, 8, 2, 6, 6, 6, 6, 6, 8, 9,
- 10, 4, 6, 6, 6, 6, 7, 9, 10, 11, 4, 7, 7, 7, 7, 7,
- 9, 10, 12, 5, 7, 7, 7, 7, 7, 9, 10, 11, 6, 8, 8, 7,
- 7, 7, 8, 9, 10, 6, 9, 8, 8, 7, 8, 10, 10, 11, 7, 9,
- 9, 8, 8, 8, 9, 9, 10, 8, 10, 10, 9, 9, 9, 11, 11, 11,
- 8, 11, 10, 10, 9, 9, 10, 11, 10, 10, 12, 12, 11, 11, 10, 11,
- 12, 11, 10, 13, 12, 11, 11, 10, 10, 11, 11, 11, 15, 13, 13, 13,
- 12, 12, 12, 12, 10, 15, 14, 13, 12, 12, 11, 11, 11, 11
- },
- {
- 4, 5, 6, 6, 6, 7, 8, 8, 2, 4, 5, 6, 6, 7, 8, 8,
- 9, 4, 6, 7, 7, 8, 8, 9, 10, 11, 5, 6, 7, 7, 8, 8,
- 9, 10, 12, 5, 7, 8, 8, 8, 9, 10, 11, 12, 5, 7, 8, 8,
- 8, 8, 9, 10, 11, 6, 8, 9, 8, 8, 9, 10, 11, 13, 5, 8,
- 9, 8, 8, 9, 9, 10, 11, 6, 10, 10, 9, 9, 10, 10, 12, 13,
- 6, 10, 10, 9, 9, 10, 10, 11, 13, 7, 11, 11, 11, 11, 11, 12,
- 12, 13, 7, 11, 11, 11, 11, 11, 11, 12, 12, 9, 13, 13, 13, 13,
- 12, 12, 13, 12, 9, 12, 13, 12, 12, 12, 13, 13, 12, 12
- },
- {
- 3, 5, 6, 8, 9, 10, 12, 12, 1, 5, 6, 7, 8, 9, 12, 12,
- 12, 4, 6, 7, 8, 9, 12, 12, 14, 21, 4, 6, 8, 9, 9, 12,
- 13, 13, 14, 6, 9, 8, 8, 9, 13, 14, 13, 21, 6, 9, 9, 8,
- 9, 10, 11, 12, 13, 8, 10, 10, 11, 11, 12, 12, 21, 21, 8, 11,
- 10, 11, 11, 12, 13, 14, 21, 9, 13, 10, 11, 13, 13, 12, 21, 21,
- 9, 12, 10, 11, 12, 12, 13, 14, 21, 11, 15, 21, 13, 14, 15, 21,
- 15, 21, 10, 14, 14, 13, 13, 21, 13, 13, 21, 13, 21, 21, 21, 20,
- 20, 14, 20, 20, 11, 14, 14, 20, 20, 13, 20, 20, 14, 16
- },
- {
- 2, 5, 6, 8, 9, 10, 13, 13, 2, 4, 5, 6, 8, 9, 10, 13,
- 14, 3, 5, 7, 8, 10, 12, 15, 20, 16, 4, 6, 8, 8, 10, 12,
- 13, 20, 20, 7, 8, 8, 9, 10, 11, 12, 16, 20, 7, 8, 8, 8,
- 10, 11, 13, 20, 20, 8, 10, 10, 10, 10, 11, 12, 15, 14, 8, 9,
- 9, 9, 10, 10, 13, 13, 20, 11, 12, 11, 11, 11, 13, 12, 13, 20,
- 11, 12, 11, 11, 12, 12, 13, 13, 20, 10, 14, 11, 11, 12, 12, 13,
- 20, 20, 11, 13, 12, 11, 12, 13, 14, 14, 20, 11, 19, 19, 13, 13,
- 15, 15, 16, 16, 11, 13, 14, 11, 13, 12, 13, 16, 16, 16
- }
-};
-
const uint8_t ff_wmv3_dc_scale_table[32] = {
0, 2, 4, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13,
14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21
};
-/* P-Picture CBPCY VLC tables */
-// Looks like original tables are not conforming to standard at all. Are they used for old WMV?
-const uint16_t ff_vc1_cbpcy_p_codes[4][64] = {
- {
- 0, 6, 15, 13, 13, 11, 3, 13, 5, 8, 49, 10, 12, 114, 102, 119,
- 1, 54, 96, 8, 10, 111, 5, 15, 12, 10, 2, 12, 13, 115, 53, 63,
- 1, 7, 1, 7, 14, 12, 4, 14, 1, 9, 97, 11, 7, 58, 52, 62,
- 4, 103, 1, 9, 11, 56, 101, 118, 4, 110, 100, 30, 2, 5, 4, 3
- },
- {
- 0, 9, 1, 18, 5, 14, 237, 26, 3, 121, 3, 22, 13, 16, 6, 30,
- 2, 10, 1, 20, 12, 241, 5, 28, 16, 12, 3, 24, 28, 124, 239, 247,
- 1, 240, 1, 19, 18, 15, 4, 27, 1, 122, 2, 23, 1, 17, 7, 31,
- 1, 11, 2, 21, 19, 246, 238, 29, 17, 13, 236, 25, 58, 63, 8, 125
- },
- {
- 0, 201, 25, 231, 5, 221, 1, 3, 2, 414, 2, 241, 16, 225, 195, 492,
- 2, 412, 1, 240, 7, 224, 98, 245, 1, 220, 96, 5, 9, 230, 101, 247,
- 1, 102, 1, 415, 24, 3, 2, 244, 3, 54, 3, 484, 17, 114, 200, 493,
- 3, 413, 1, 4, 13, 113, 99, 485, 4, 111, 194, 243, 5, 29, 26, 31
- },
- {
- 0, 28, 12, 44, 3, 36, 20, 52, 2, 32, 16, 48, 8, 40, 24, 28,
- 1, 30, 14, 46, 6, 38, 22, 54, 3, 34, 18, 50, 10, 42, 26, 30,
- 1, 29, 13, 45, 5, 37, 21, 53, 2, 33, 17, 49, 9, 41, 25, 29,
- 1, 31, 15, 47, 7, 39, 23, 55, 4, 35, 19, 51, 11, 43, 27, 31
- }
-};
-
-const uint8_t ff_vc1_cbpcy_p_bits[4][64] = {
- {
- 13, 13, 7, 13, 7, 13, 13, 12, 6, 13, 7, 12, 6, 8, 8, 8,
- 5, 7, 8, 12, 6, 8, 13, 12, 7, 13, 13, 12, 6, 8, 7, 7,
- 6, 13, 8, 12, 7, 13, 13, 12, 7, 13, 8, 12, 5, 7, 7, 7,
- 6, 8, 13, 12, 6, 7, 8, 8, 5, 8, 8, 6, 3, 3, 3, 2
- },
- {
- 14, 13, 8, 13, 3, 13, 8, 13, 3, 7, 8, 13, 4, 13, 13, 13,
- 3, 13, 13, 13, 4, 8, 13, 13, 5, 13, 13, 13, 5, 7, 8, 8,
- 3, 8, 14, 13, 5, 13, 13, 13, 4, 7, 13, 13, 6, 13, 13, 13,
- 5, 13, 8, 13, 5, 8, 8, 13, 5, 13, 8, 13, 6, 6, 13, 7
- },
- {
- 13, 8, 6, 8, 4, 8, 13, 12, 4, 9, 8, 8, 5, 8, 8, 9,
- 5, 9, 10, 8, 4, 8, 7, 8, 6, 8, 7, 13, 4, 8, 7, 8,
- 5, 7, 8, 9, 6, 13, 13, 8, 4, 6, 8, 9, 5, 7, 8, 9,
- 5, 9, 9, 13, 5, 7, 7, 9, 4, 7, 8, 8, 3, 5, 5, 5
- },
- {
- 9, 9, 9, 9, 2, 9, 9, 9, 2, 9, 9, 9, 9, 9, 9, 8,
- 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8,
- 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8
- }
-};
-
-/* Interlaced CBPCY VLC tables (Table 124 - Table 131) */
-const uint16_t ff_vc1_icbpcy_p_codes[8][63] = {
- {
- 0x2F1A, 0x2F1B, 0x178C, 0x0090, 0x02A8, 0x02A9, 0x0BC7, 0x0091,
- 0x02AA, 0x02AB, 0x05E0, 0x004A, 0x0096, 0x0097, 0x00BD, 0x0092,
- 0x02AC, 0x02AD, 0x05E1, 0x0098, 0x0132, 0x0133, 0x0179, 0x0134,
- 0x026A, 0x026B, 0x02FC, 0x004E, 0x0040, 0x0041, 0x002B, 0x0093,
- 0x02AE, 0x02AF, 0x05E2, 0x0136, 0x026E, 0x026F, 0x02FD, 0x009E,
- 0x013E, 0x013F, 0x017F, 0x0050, 0x0042, 0x0043, 0x002C, 0x0051,
- 0x00A4, 0x00A5, 0x00BE, 0x0053, 0x0044, 0x0045, 0x002D, 0x0054,
- 0x0046, 0x0047, 0x002E, 0x0003, 0x0000, 0x0001, 0x0001
- },
- {
- 0x0041, 0x0042, 0x0100, 0x0043, 0x0088, 0x0089, 0x0101, 0x0045,
- 0x008C, 0x008D, 0x0102, 0x0010, 0x0022, 0x0023, 0x0024, 0x0047,
- 0x0010, 0x0011, 0x0103, 0x0025, 0x0058, 0x0059, 0x005A, 0x005B,
- 0x005A, 0x005B, 0x005C, 0x000C, 0x0030, 0x0031, 0x0019, 0x0009,
- 0x0014, 0x0015, 0x002C, 0x005C, 0x005D, 0x005E, 0x005F, 0x0026,
- 0x005D, 0x005E, 0x005F, 0x000D, 0x0034, 0x0035, 0x001B, 0x0014,
- 0x0027, 0x002A, 0x002B, 0x000E, 0x0038, 0x0039, 0x001D, 0x000F,
- 0x003C, 0x003D, 0x001F, 0x0005, 0x0009, 0x0000, 0x0003
- },
- {
- 0x0032, 0x0033, 0x001A, 0x0026, 0x00E4, 0x00E5, 0x01E6, 0x0027,
- 0x00E6, 0x00E7, 0x01E7, 0x000E, 0x0063, 0x006C, 0x0077, 0x0028,
- 0x00E8, 0x00E9, 0x01E8, 0x007B, 0x00DA, 0x00DB, 0x00EC, 0x00F5,
- 0x01B8, 0x01B9, 0x01DA, 0x0021, 0x004B, 0x0054, 0x002B, 0x0029,
- 0x00EA, 0x00EB, 0x01E9, 0x004A, 0x01BA, 0x01BB, 0x01DB, 0x0020,
- 0x00DE, 0x00DF, 0x00F2, 0x0022, 0x0055, 0x0058, 0x002D, 0x000F,
- 0x0070, 0x0071, 0x0078, 0x0023, 0x0059, 0x005C, 0x002F, 0x0024,
- 0x005D, 0x0062, 0x0030, 0x0002, 0x001F, 0x0006, 0x0000
- },
- {
- 0x0028, 0x0029, 0x009D, 0x0000, 0x01EA, 0x01EB, 0x01EC, 0x0001,
- 0x01ED, 0x01EE, 0x01EF, 0x0005, 0x00F0, 0x00F1, 0x003B, 0x0002,
- 0x01F0, 0x01F1, 0x01F2, 0x003F, 0x015C, 0x015D, 0x0099, 0x0010,
- 0x03D0, 0x03D1, 0x0130, 0x000F, 0x009E, 0x009F, 0x00FB, 0x0003,
- 0x01F3, 0x01F4, 0x01F5, 0x0011, 0x03D2, 0x03D3, 0x0131, 0x0009,
- 0x015E, 0x015F, 0x009C, 0x0010, 0x00A8, 0x00A9, 0x0038, 0x0006,
- 0x00F2, 0x00F3, 0x004D, 0x0011, 0x00AA, 0x00AB, 0x0039, 0x0012,
- 0x00AC, 0x00AD, 0x003A, 0x0006, 0x0016, 0x0017, 0x000E
- },
- {
- 0x003C, 0x003D, 0x001F, 0x000A, 0x0061, 0x0062, 0x0002, 0x000B,
- 0x0063, 0x0064, 0x0003, 0x0007, 0x0003, 0x0004, 0x000B, 0x000C,
- 0x0065, 0x0066, 0x0004, 0x0012, 0x000A, 0x000B, 0x0014, 0x001B,
- 0x0018, 0x0019, 0x0034, 0x002C, 0x0067, 0x0068, 0x0035, 0x000D,
- 0x0069, 0x006C, 0x0005, 0x0060, 0x001A, 0x001B, 0x0035, 0x0013,
- 0x000E, 0x000F, 0x0015, 0x002D, 0x006D, 0x006E, 0x0038, 0x0008,
- 0x0008, 0x0009, 0x000C, 0x002E, 0x006F, 0x0072, 0x003A, 0x002F,
- 0x0073, 0x0000, 0x003B, 0x0007, 0x0014, 0x0015, 0x0004
- },
- {
- 0x0038, 0x0039, 0x009D, 0x000A, 0x0091, 0x0092, 0x0093, 0x000B,
- 0x0094, 0x0095, 0x0096, 0x0003, 0x00EE, 0x00EF, 0x0036, 0x000C,
- 0x0097, 0x0098, 0x0099, 0x0008, 0x01E4, 0x01E5, 0x006A, 0x0018,
- 0x03CC, 0x03CD, 0x00D6, 0x000E, 0x009E, 0x009F, 0x00F5, 0x000D,
- 0x009A, 0x009B, 0x009C, 0x0019, 0x03CE, 0x03CF, 0x00D7, 0x0009,
- 0x01E8, 0x01E9, 0x0090, 0x000F, 0x00E8, 0x00E9, 0x00F6, 0x0005,
- 0x00F0, 0x00F1, 0x0037, 0x0010, 0x00EA, 0x00EB, 0x00F7, 0x0011,
- 0x00EC, 0x00ED, 0x0034, 0x0000, 0x003E, 0x003F, 0x0002
- },
- {
- 0x003C, 0x003D, 0x01CF, 0x0000, 0x00BF, 0x00E0, 0x01FC, 0x0001,
- 0x00E1, 0x00E2, 0x01FD, 0x0009, 0x01F1, 0x01F2, 0x01F3, 0x0002,
- 0x00E3, 0x00E4, 0x01FE, 0x0011, 0x03EE, 0x03EF, 0x03F0, 0x0021,
- 0x07E2, 0x07E3, 0x07E4, 0x0018, 0x03F7, 0x03FE, 0x03FF, 0x0003,
- 0x00E5, 0x00E6, 0x0080, 0x002E, 0x07E5, 0x07E6, 0x07E7, 0x0016,
- 0x03F4, 0x03F5, 0x03F6, 0x0019, 0x0102, 0x0103, 0x0104, 0x000A,
- 0x01F4, 0x01F5, 0x01F6, 0x001A, 0x0105, 0x0106, 0x0107, 0x001B,
- 0x0178, 0x0179, 0x01CE, 0x001D, 0x00BD, 0x00BE, 0x01F0
- },
- {
- 0x0003, 0x0004, 0x01B6, 0x0004, 0x002E, 0x002F, 0x000E, 0x0005,
- 0x0030, 0x0031, 0x000F, 0x0003, 0x000A, 0x000B, 0x0014, 0x0006,
- 0x0032, 0x0033, 0x0010, 0x0005, 0x0030, 0x0031, 0x0032, 0x0009,
- 0x0066, 0x0067, 0x0068, 0x001D, 0x01B7, 0x01B8, 0x01B9, 0x0007,
- 0x0034, 0x0035, 0x0011, 0x0016, 0x0069, 0x006A, 0x006B, 0x000A,
- 0x0036, 0x0037, 0x00D8, 0x001E, 0x01BA, 0x01BB, 0x01BC, 0x0004,
- 0x0015, 0x0016, 0x0017, 0x001F, 0x01BD, 0x01BE, 0x01BF, 0x0000,
- 0x0010, 0x0011, 0x0012, 0x001C, 0x00D9, 0x00DA, 0x0013
- }
-};
-
-const uint8_t ff_vc1_icbpcy_p_bits[8][63] = {
- {
- 15, 15, 14, 9, 11, 11, 13, 9, 11, 11, 12, 8, 9, 9, 9, 9,
- 11, 11, 12, 9, 10, 10, 10, 10, 11, 11, 11, 8, 8, 8, 7, 9,
- 11, 11, 12, 10, 11, 11, 11, 9, 10, 10, 10, 8, 8, 8, 7, 8,
- 9, 9, 9, 8, 8, 8, 7, 8, 8, 8, 7, 3, 3, 3, 1
- },
- {
- 7, 7, 9, 7, 8, 8, 9, 7, 8, 8, 9, 6, 7, 7, 7, 7,
- 7, 7, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6,
- 7, 7, 8, 8, 9, 9, 9, 7, 8, 8, 8, 6, 7, 7, 6, 6,
- 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 4, 3, 2
- },
- {
- 6, 6, 5, 6, 8, 8, 9, 6, 8, 8, 9, 5, 7, 7, 7, 6,
- 8, 8, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6,
- 8, 8, 9, 7, 9, 9, 9, 6, 8, 8, 8, 6, 7, 7, 6, 5,
- 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 5, 4, 2
- },
- {
- 6, 6, 8, 4, 9, 9, 9, 4, 9, 9, 9, 4, 8, 8, 7, 4,
- 9, 9, 9, 6, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4,
- 9, 9, 9, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 7, 4,
- 8, 8, 7, 5, 8, 8, 7, 5, 8, 8, 7, 3, 5, 5, 4
- },
- {
- 6, 6, 5, 5, 7, 7, 7, 5, 7, 7, 7, 5, 6, 6, 6, 5,
- 7, 7, 7, 6, 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 6, 5,
- 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 7, 6, 7, 7, 6, 5,
- 6, 6, 6, 6, 7, 7, 6, 6, 7, 6, 6, 4, 5, 5, 3
- },
- {
- 6, 6, 8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 8, 7, 4,
- 8, 8, 8, 5, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4,
- 8, 8, 8, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 8, 4,
- 8, 8, 7, 5, 8, 8, 8, 5, 8, 8, 7, 3, 6, 6, 4
- },
- {
- 6, 6, 9, 3, 8, 8, 9, 3, 8, 8, 9, 4, 9, 9, 9, 3,
- 8, 8, 9, 5, 10, 10, 10, 6, 11, 11, 11, 5, 10, 10, 10, 3,
- 8, 8, 8, 6, 11, 11, 11, 5, 10, 10, 10, 5, 9, 9, 9, 4,
- 9, 9, 9, 5, 9, 9, 9, 5, 9, 9, 9, 5, 8, 8, 9
- },
- {
- 6, 6, 10, 3, 7, 7, 7, 3, 7, 7, 7, 4, 8, 8, 8, 3,
- 7, 7, 7, 5, 9, 9, 9, 6, 10, 10, 10, 6, 10, 10, 10, 3,
- 7, 7, 7, 6, 10, 10, 10, 5, 9, 9, 9, 6, 10, 10, 10, 4,
- 8, 8, 8, 6, 10, 10, 10, 5, 9, 9, 9, 6, 9, 9, 9
- }
-};
-
-/* MacroBlock Transform Type: 7.1.3.11, p89
- * 8x8:B
- * 8x4:B:btm 8x4:B:top 8x4:B:both,
- * 4x8:B:right 4x8:B:left 4x8:B:both
- * 4x4:B 8x8:MB
- * 8x4:MB:btm 8x4:MB:top 8x4,MB,both
- * 4x8,MB,right 4x8,MB,left
- * 4x4,MB */
-const uint16_t ff_vc1_ttmb_codes[3][16] = {
- {
- 0x0003,
- 0x002E, 0x005F, 0x0000,
- 0x0016, 0x0015, 0x0001,
- 0x0004, 0x0014,
- 0x02F1, 0x0179, 0x017B,
- 0x0BC0, 0x0BC1, 0x05E1,
- 0x017A
- },
- {
- 0x0006,
- 0x0006, 0x0003, 0x0007,
- 0x000F, 0x000E, 0x0000,
- 0x0002, 0x0002,
- 0x0014, 0x0011, 0x000B,
- 0x0009, 0x0021, 0x0015,
- 0x0020
- },
- {
- 0x0006,
- 0x0000, 0x000E, 0x0005,
- 0x0002, 0x0003, 0x0003,
- 0x000F, 0x0002,
- 0x0081, 0x0021, 0x0009,
- 0x0101, 0x0041, 0x0011,
- 0x0100
- }
-};
-
-const uint8_t ff_vc1_ttmb_bits[3][16] = {
- {
- 2,
- 6, 7, 2,
- 5, 5, 2,
- 3, 5,
- 10, 9, 9,
- 12, 12, 11,
- 9
- },
- {
- 3,
- 4, 4, 4,
- 4, 4, 3,
- 3, 2,
- 7, 7, 6,
- 6, 8, 7,
- 8
- },
- {
- 3,
- 3, 4, 5,
- 3, 3, 4,
- 4, 2,
- 10, 8, 6,
- 11, 9, 7,
- 11
- }
-};
-
-/* TTBLK (Transform Type per Block) tables */
-const uint8_t ff_vc1_ttblk_codes[3][8] = {
- { 0, 1, 3, 5, 16, 17, 18, 19 },
- { 3, 0, 1, 2, 3, 5, 8, 9 },
- { 1, 0, 1, 4, 6, 7, 10, 11 }
-};
-const uint8_t ff_vc1_ttblk_bits[3][8] = {
- { 2, 2, 2, 3, 5, 5, 5, 5 },
- { 2, 3, 3, 3, 3, 3, 4, 4 },
- { 2, 3, 3, 3, 3, 3, 4, 4 }
-};
-
-/* SUBBLKPAT tables, p93-94, reordered */
-const uint8_t ff_vc1_subblkpat_codes[3][15] = {
- { 14, 12, 7, 11, 9, 26, 2, 10, 27, 8, 0, 6, 1, 15, 1 },
- { 14, 0, 8, 15, 10, 4, 23, 13, 5, 9, 25, 3, 24, 22, 1 },
- { 5, 6, 2, 2, 8, 0, 28, 3, 1, 3, 29, 1, 19, 18, 15 }
-};
-const uint8_t ff_vc1_subblkpat_bits[3][15] = {
- { 5, 5, 5, 5, 5, 6, 4, 5, 6, 5, 4, 5, 4, 5, 1},
- { 4, 3, 4, 4, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 2},
- { 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4}
-};
-
-/* MV differential tables, p265 */
-const uint16_t ff_vc1_mv_diff_codes[4][73] = {
- {
- 0, 2, 3, 8, 576, 3, 2, 6,
- 5, 577, 578, 7, 8, 9, 40, 19,
- 37, 82, 21, 22, 23, 579, 580, 166,
- 96, 167, 49, 194, 195, 581, 582, 583,
- 292, 293, 294, 13, 2, 7, 24, 50,
- 102, 295, 13, 7, 8, 18, 50, 103,
- 38, 20, 21, 22, 39, 204, 103, 23,
- 24, 25, 104, 410, 105, 106, 107, 108,
- 109, 220, 411, 442, 222, 443, 446, 447,
- 7 /* 73 elements */
- },
- {
- 0, 4, 5, 3, 4, 3, 4, 5,
- 20, 6, 21, 44, 45, 46, 3008, 95,
- 112, 113, 57, 3009, 3010, 116, 117, 3011,
- 118, 3012, 3013, 3014, 3015, 3016, 3017, 3018,
- 3019, 3020, 3021, 3022, 1, 4, 15, 160,
- 161, 41, 6, 11, 42, 162, 43, 119,
- 56, 57, 58, 163, 236, 237, 3023, 119,
- 120, 242, 122, 486, 1512, 487, 246, 494,
- 1513, 495, 1514, 1515, 1516, 1517, 1518, 1519,
- 31 /* 73 elements */
- },
- {
- 0, 512, 513, 514, 515, 2, 3, 258,
- 259, 260, 261, 262, 263, 264, 265, 266,
- 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, 281, 282,
- 283, 284, 285, 286, 1, 5, 287, 288,
- 289, 290, 6, 7, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 300, 301, 302,
- 303, 304, 305, 306, 307, 308, 309, 310,
- 311, 312, 313, 314, 315, 316, 317, 318,
- 319 /* 73 elements */
- },
- {
- 0, 1, 1, 2, 3, 4, 1, 5,
- 4, 3, 5, 8, 6, 9, 10, 11,
- 12, 7, 104, 14, 105, 4, 10, 15,
- 11, 6, 14, 8, 106, 107, 108, 15,
- 109, 9, 55, 10, 1, 2, 1, 2,
- 3, 12, 6, 2, 6, 7, 28, 7,
- 15, 8, 5, 18, 29, 152, 77, 24,
- 25, 26, 39, 108, 13, 109, 55, 56,
- 57, 116, 11, 153, 234, 235, 118, 119,
- 15 /* 73 elements */
- }
-};
-const uint8_t ff_vc1_mv_diff_bits[4][73] = {
- {
- 6, 7, 7, 8, 14, 6, 5, 6, 7, 14, 14, 6, 6, 6, 8, 9,
- 10, 9, 7, 7, 7, 14, 14, 10, 9, 10, 8, 10, 10, 14, 14, 14,
- 13, 13, 13, 6, 3, 5, 6, 8, 9, 13, 5, 4, 4, 5, 7, 9,
- 6, 5, 5, 5, 6, 9, 8, 5, 5, 5, 7, 10, 7, 7, 7, 7,
- 7, 8, 10, 9, 8, 9, 9, 9, 3 /* 73 elements */
- },
- {
- 5, 7, 7, 6, 6, 5, 5, 6, 7, 5, 7, 8, 8, 8, 14, 9,
- 9, 9, 8, 14, 14, 9, 9, 14, 9, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 2, 3, 6, 8, 8, 6, 3, 4, 6, 8, 6, 9,
- 6, 6, 6, 8, 8, 8, 14, 7, 7, 8, 7, 9, 13, 9, 8, 9,
- 13, 9, 13, 13, 13, 13, 13, 13, 5 /* 73 elements */
-
- },
- {
- 3, 12, 12, 12, 12, 3, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 1, 5, 11, 11, 11, 11, 4, 4, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11 /* 73 elements */
- },
- {
- 15, 11, 15, 15, 15, 15, 12, 15, 12, 11, 12, 12, 15, 12, 12, 12,
- 12, 15, 15, 12, 15, 10, 11, 12, 11, 10, 11, 10, 15, 15, 15, 11,
- 15, 10, 14, 10, 4, 4, 5, 7, 8, 9, 5, 3, 4, 5, 6, 8,
- 5, 4, 3, 5, 6, 8, 7, 5, 5, 5, 6, 7, 9, 7, 6, 6,
- 6, 7, 10, 8, 8, 8, 7, 7, 4 /* 73 elements */
- }
-};
/* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */
@@ -1089,7 +289,3 @@ const uint16_t ff_vc1_b_field_mvpred_scales[7][4] = {
{ 26, 17, 12, 10 }, // ZONE1OFFSET_X
{ 7, 4, 3, 3 } // ZONE1OFFSET_Y
};
-
-const int ff_vc1_ac_sizes[AC_MODES] = {
- 186, 169, 133, 149, 103, 103, 163, 175
-};
diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h
index b73e0a5f0e..dcd51e6a05 100644
--- a/libavcodec/vc1data.h
+++ b/libavcodec/vc1data.h
@@ -103,78 +103,8 @@ extern const int16_t ff_vc1_bfraction_lut[23];
//Same as H.264
extern const AVRational ff_vc1_pixel_aspect[16];
-/* BitPlane IMODE - such a small table... */
-extern const uint8_t ff_vc1_imode_codes[7];
-extern const uint8_t ff_vc1_imode_bits[7];
-
-/* Normal-2 imode */
-extern const uint8_t ff_vc1_norm2_codes[4];
-extern const uint8_t ff_vc1_norm2_bits[4];
-extern const uint16_t ff_vc1_norm6_codes[64];
-extern const uint8_t ff_vc1_norm6_bits[64];
-
-/* 4MV Block pattern VLC tables */
-extern const uint8_t ff_vc1_4mv_block_pattern_codes[4][16];
-extern const uint8_t ff_vc1_4mv_block_pattern_bits[4][16];
-
-/* 2MV Block pattern VLC tables */
-extern const uint8_t ff_vc1_2mv_block_pattern_codes[4][4];
-extern const uint8_t ff_vc1_2mv_block_pattern_bits[4][4];
-
extern const uint8_t ff_wmv3_dc_scale_table[32];
-/* P-Picture CBPCY VLC tables */
-extern const uint16_t ff_vc1_cbpcy_p_codes[4][64];
-extern const uint8_t ff_vc1_cbpcy_p_bits[4][64];
-
-/* Interlaced CBPCY VLC tables (Table 124 - Table 131) */
-extern const uint16_t ff_vc1_icbpcy_p_codes[8][63];
-extern const uint8_t ff_vc1_icbpcy_p_bits[8][63];
-
-/* MacroBlock Transform Type: 7.1.3.11, p89
- * 8x8:B
- * 8x4:B:btm 8x4:B:top 8x4:B:both,
- * 4x8:B:right 4x8:B:left 4x8:B:both
- * 4x4:B 8x8:MB
- * 8x4:MB:btm 8x4:MB:top 8x4,MB,both
- * 4x8,MB,right 4x8,MB,left
- * 4x4,MB */
-extern const uint16_t ff_vc1_ttmb_codes[3][16];
-
-extern const uint8_t ff_vc1_ttmb_bits[3][16];
-
-/* TTBLK (Transform Type per Block) tables */
-extern const uint8_t ff_vc1_ttblk_codes[3][8];
-extern const uint8_t ff_vc1_ttblk_bits[3][8];
-
-/* SUBBLKPAT tables, p93-94, reordered */
-extern const uint8_t ff_vc1_subblkpat_codes[3][15];
-extern const uint8_t ff_vc1_subblkpat_bits[3][15];
-
-/* MV differential tables, p265 */
-extern const uint16_t ff_vc1_mv_diff_codes[4][73];
-extern const uint8_t ff_vc1_mv_diff_bits[4][73];
-
-/* Interlaced frame picture MBMODE VLC tables (p. 246, p. 360) */
-extern const uint16_t ff_vc1_intfr_4mv_mbmode_codes[4][15];
-extern const uint8_t ff_vc1_intfr_4mv_mbmode_bits[4][15];
-extern const uint8_t ff_vc1_intfr_non4mv_mbmode_codes[4][9];
-extern const uint8_t ff_vc1_intfr_non4mv_mbmode_bits[4][9];
-
-/* Interlaced field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */
-extern const uint8_t ff_vc1_if_mmv_mbmode_codes[8][8];
-extern const uint8_t ff_vc1_if_mmv_mbmode_bits[8][8];
-extern const uint8_t ff_vc1_if_1mv_mbmode_codes[8][6];
-extern const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6];
-
-/* Interlaced frame/field picture MVDATA VLC tables */
-/* 1-reference tables */
-extern const uint32_t ff_vc1_1ref_mvdata_codes[4][72];
-extern const uint8_t ff_vc1_1ref_mvdata_bits[4][72];
-/* 2-reference tables */
-extern const uint32_t ff_vc1_2ref_mvdata_codes[8][126];
-extern const uint8_t ff_vc1_2ref_mvdata_bits[8][126];
-
/* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */
/* Scantables/ZZ scan are at 11.9 (p262) and 8.1.1.12 (p10) */
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 11/19] avcodec/vc1: Move ff_vc1_init_common() to vc1dec.c
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (8 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 10/19] avcodec/vc1data: Move VLC codes/lengths tables to a header Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 12/19] avcodec/vc1_block: Don't duplicate #defines Andreas Rheinhardt
` (13 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
This is possible given that it is no longer used
by the parser.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1.c | 362 --------------------------------------
libavcodec/vc1_vlc_data.h | 221 +++++++++++++++++++++++
libavcodec/vc1dec.c | 141 +++++++++++++++
3 files changed, 362 insertions(+), 362 deletions(-)
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 5214bcdedf..d4014d25ab 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -26,14 +26,11 @@
* VC-1 and WMV3 decoder common code
*/
-#include "libavutil/attributes.h"
-#include "libavutil/thread.h"
#include "avcodec.h"
#include "decode.h"
#include "mpegvideo.h"
#include "vc1.h"
#include "vc1data.h"
-#include "vc1_vlc_data.h"
#include "wmv2data.h"
#include "unary.h"
@@ -1339,362 +1336,3 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
return 0;
}
-
-static const uint32_t vc1_ac_tables[AC_MODES][186][2] = {
-{
-{ 0x0001, 2}, { 0x0005, 3}, { 0x000D, 4}, { 0x0012, 5}, { 0x000E, 6}, { 0x0015, 7},
-{ 0x0013, 8}, { 0x003F, 8}, { 0x004B, 9}, { 0x011F, 9}, { 0x00B8, 10}, { 0x03E3, 10},
-{ 0x0172, 11}, { 0x024D, 12}, { 0x03DA, 12}, { 0x02DD, 13}, { 0x1F55, 13}, { 0x05B9, 14},
-{ 0x3EAE, 14}, { 0x0000, 4}, { 0x0010, 5}, { 0x0008, 7}, { 0x0020, 8}, { 0x0029, 9},
-{ 0x01F4, 9}, { 0x0233, 10}, { 0x01E0, 11}, { 0x012A, 12}, { 0x03DD, 12}, { 0x050A, 13},
-{ 0x1F29, 13}, { 0x0A42, 14}, { 0x1272, 15}, { 0x1737, 15}, { 0x0003, 5}, { 0x0011, 7},
-{ 0x00C4, 8}, { 0x004B, 10}, { 0x00B4, 11}, { 0x07D4, 11}, { 0x0345, 12}, { 0x02D7, 13},
-{ 0x07BF, 13}, { 0x0938, 14}, { 0x0BBB, 14}, { 0x095E, 15}, { 0x0013, 5}, { 0x0078, 7},
-{ 0x0069, 9}, { 0x0232, 10}, { 0x0461, 11}, { 0x03EC, 12}, { 0x0520, 13}, { 0x1F2A, 13},
-{ 0x3E50, 14}, { 0x3E51, 14}, { 0x1486, 15}, { 0x000C, 6}, { 0x0024, 9}, { 0x0094, 11},
-{ 0x08C0, 12}, { 0x0F09, 14}, { 0x1EF0, 15}, { 0x003D, 6}, { 0x0053, 9}, { 0x01A0, 11},
-{ 0x02D6, 13}, { 0x0F08, 14}, { 0x0013, 7}, { 0x007C, 9}, { 0x07C1, 11}, { 0x04AC, 14},
-{ 0x001B, 7}, { 0x00A0, 10}, { 0x0344, 12}, { 0x0F79, 14}, { 0x0079, 7}, { 0x03E1, 10},
-{ 0x02D4, 13}, { 0x2306, 14}, { 0x0021, 8}, { 0x023C, 10}, { 0x0FAE, 12}, { 0x23DE, 14},
-{ 0x0035, 8}, { 0x0175, 11}, { 0x07B3, 13}, { 0x00C5, 8}, { 0x0174, 11}, { 0x0785, 13},
-{ 0x0048, 9}, { 0x01A3, 11}, { 0x049E, 13}, { 0x002C, 9}, { 0x00FA, 10}, { 0x07D6, 11},
-{ 0x0092, 10}, { 0x05CC, 13}, { 0x1EF1, 15}, { 0x00A3, 10}, { 0x03ED, 12}, { 0x093E, 14},
-{ 0x01E2, 11}, { 0x1273, 15}, { 0x07C4, 11}, { 0x1487, 15}, { 0x0291, 12}, { 0x0293, 12},
-{ 0x0F8A, 12}, { 0x0509, 13}, { 0x0508, 13}, { 0x078D, 13}, { 0x07BE, 13}, { 0x078C, 13},
-{ 0x04AE, 14}, { 0x0BBA, 14}, { 0x2307, 14}, { 0x0B9A, 14}, { 0x1736, 15}, { 0x000E, 4},
-{ 0x0045, 7}, { 0x01F3, 9}, { 0x047A, 11}, { 0x05DC, 13}, { 0x23DF, 14}, { 0x0019, 5},
-{ 0x0028, 9}, { 0x0176, 11}, { 0x049D, 13}, { 0x23DD, 14}, { 0x0030, 6}, { 0x00A2, 10},
-{ 0x02EF, 12}, { 0x05B8, 14}, { 0x003F, 6}, { 0x00A5, 10}, { 0x03DB, 12}, { 0x093F, 14},
-{ 0x0044, 7}, { 0x07CB, 11}, { 0x095F, 15}, { 0x0063, 7}, { 0x03C3, 12}, { 0x0015, 8},
-{ 0x08F6, 12}, { 0x0017, 8}, { 0x0498, 13}, { 0x002C, 8}, { 0x07B2, 13}, { 0x002F, 8},
-{ 0x1F54, 13}, { 0x008D, 8}, { 0x07BD, 13}, { 0x008E, 8}, { 0x1182, 13}, { 0x00FB, 8},
-{ 0x050B, 13}, { 0x002D, 8}, { 0x07C0, 11}, { 0x0079, 9}, { 0x1F5F, 13}, { 0x007A, 9},
-{ 0x1F56, 13}, { 0x0231, 10}, { 0x03E4, 10}, { 0x01A1, 11}, { 0x0143, 11}, { 0x01F7, 11},
-{ 0x016F, 12}, { 0x0292, 12}, { 0x02E7, 12}, { 0x016C, 12}, { 0x016D, 12}, { 0x03DC, 12},
-{ 0x0F8B, 12}, { 0x0499, 13}, { 0x03D8, 12}, { 0x078E, 13}, { 0x02D5, 13}, { 0x1F5E, 13},
-{ 0x1F2B, 13}, { 0x078F, 13}, { 0x04AD, 14}, { 0x3EAF, 14}, { 0x23DC, 14}, { 0x004A, 9}
-},
-{
-{ 0x0000, 3}, { 0x0003, 4}, { 0x000B, 5}, { 0x0014, 6}, { 0x003F, 6}, { 0x005D, 7},
-{ 0x00A2, 8}, { 0x00AC, 9}, { 0x016E, 9}, { 0x020A, 10}, { 0x02E2, 10}, { 0x0432, 11},
-{ 0x05C9, 11}, { 0x0827, 12}, { 0x0B54, 12}, { 0x04E6, 13}, { 0x105F, 13}, { 0x172A, 13},
-{ 0x20B2, 14}, { 0x2D4E, 14}, { 0x39F0, 14}, { 0x4175, 15}, { 0x5A9E, 15}, { 0x0004, 4},
-{ 0x001E, 5}, { 0x0042, 7}, { 0x00B6, 8}, { 0x0173, 9}, { 0x0395, 10}, { 0x072E, 11},
-{ 0x0B94, 12}, { 0x16A4, 13}, { 0x20B3, 14}, { 0x2E45, 14}, { 0x0005, 5}, { 0x0040, 7},
-{ 0x0049, 9}, { 0x028F, 10}, { 0x05CB, 11}, { 0x048A, 13}, { 0x09DD, 14}, { 0x73E2, 15},
-{ 0x0018, 5}, { 0x0025, 8}, { 0x008A, 10}, { 0x051B, 11}, { 0x0E5F, 12}, { 0x09C9, 14},
-{ 0x139C, 15}, { 0x0029, 6}, { 0x004F, 9}, { 0x0412, 11}, { 0x048D, 13}, { 0x2E41, 14},
-{ 0x0038, 6}, { 0x010E, 9}, { 0x05A8, 11}, { 0x105C, 13}, { 0x39F2, 14}, { 0x0058, 7},
-{ 0x021F, 10}, { 0x0E7E, 12}, { 0x39FF, 14}, { 0x0023, 8}, { 0x02E3, 10}, { 0x04E5, 13},
-{ 0x2E40, 14}, { 0x00A1, 8}, { 0x05BE, 11}, { 0x09C8, 14}, { 0x0083, 8}, { 0x013A, 11},
-{ 0x1721, 13}, { 0x0044, 9}, { 0x0276, 12}, { 0x39F6, 14}, { 0x008B, 10}, { 0x04EF, 13},
-{ 0x5A9B, 15}, { 0x0208, 10}, { 0x1CFE, 13}, { 0x0399, 10}, { 0x1CB4, 13}, { 0x039E, 10},
-{ 0x39F3, 14}, { 0x05AB, 11}, { 0x73E3, 15}, { 0x0737, 11}, { 0x5A9F, 15}, { 0x082D, 12},
-{ 0x0E69, 12}, { 0x0E68, 12}, { 0x0433, 11}, { 0x0B7B, 12}, { 0x2DF8, 14}, { 0x2E56, 14},
-{ 0x2E57, 14}, { 0x39F7, 14}, { 0x51A5, 15}, { 0x0003, 3}, { 0x002A, 6}, { 0x00E4, 8},
-{ 0x028E, 10}, { 0x0735, 11}, { 0x1058, 13}, { 0x1CFA, 13}, { 0x2DF9, 14}, { 0x4174, 15},
-{ 0x0009, 4}, { 0x0054, 8}, { 0x0398, 10}, { 0x048B, 13}, { 0x139D, 15}, { 0x000D, 4},
-{ 0x00AD, 9}, { 0x0826, 12}, { 0x2D4C, 14}, { 0x0011, 5}, { 0x016B, 9}, { 0x0B7F, 12},
-{ 0x51A4, 15}, { 0x0019, 5}, { 0x021B, 10}, { 0x16FD, 13}, { 0x001D, 5}, { 0x0394, 10},
-{ 0x28D3, 14}, { 0x002B, 6}, { 0x05BC, 11}, { 0x5A9A, 15}, { 0x002F, 6}, { 0x0247, 12},
-{ 0x0010, 7}, { 0x0A35, 12}, { 0x003E, 6}, { 0x0B7A, 12}, { 0x0059, 7}, { 0x105E, 13},
-{ 0x0026, 8}, { 0x09CF, 14}, { 0x0055, 8}, { 0x1CB5, 13}, { 0x0057, 8}, { 0x0E5B, 12},
-{ 0x00A0, 8}, { 0x1468, 13}, { 0x0170, 9}, { 0x0090, 10}, { 0x01CE, 9}, { 0x021A, 10},
-{ 0x0218, 10}, { 0x0168, 9}, { 0x021E, 10}, { 0x0244, 12}, { 0x0736, 11}, { 0x0138, 11},
-{ 0x0519, 11}, { 0x0E5E, 12}, { 0x072C, 11}, { 0x0B55, 12}, { 0x09DC, 14}, { 0x20BB, 14},
-{ 0x048C, 13}, { 0x1723, 13}, { 0x2E44, 14}, { 0x16A5, 13}, { 0x0518, 11}, { 0x39FE, 14},
-{ 0x0169, 9}
-},
-{
-{ 0x0001, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x0016, 5}, { 0x0020, 6}, { 0x0018, 7},
-{ 0x0008, 8}, { 0x009A, 8}, { 0x0056, 9}, { 0x013E, 9}, { 0x00F0, 10}, { 0x03A5, 10},
-{ 0x0077, 11}, { 0x01EF, 11}, { 0x009A, 12}, { 0x005D, 13}, { 0x0001, 4}, { 0x0011, 5},
-{ 0x0002, 7}, { 0x000B, 8}, { 0x0012, 9}, { 0x01D6, 9}, { 0x027E, 10}, { 0x0191, 11},
-{ 0x00EA, 12}, { 0x03DC, 12}, { 0x013B, 13}, { 0x0004, 5}, { 0x0014, 7}, { 0x009E, 8},
-{ 0x0009, 10}, { 0x01AC, 11}, { 0x01E2, 11}, { 0x03CA, 12}, { 0x005F, 13}, { 0x0017, 5},
-{ 0x004E, 7}, { 0x005E, 9}, { 0x00F3, 10}, { 0x01AD, 11}, { 0x00EC, 12}, { 0x05F0, 13},
-{ 0x000E, 6}, { 0x00E1, 8}, { 0x03A4, 10}, { 0x009C, 12}, { 0x013D, 13}, { 0x003B, 6},
-{ 0x001C, 9}, { 0x0014, 11}, { 0x09BE, 12}, { 0x0006, 7}, { 0x007A, 9}, { 0x0190, 11},
-{ 0x0137, 13}, { 0x001B, 7}, { 0x0008, 10}, { 0x075C, 11}, { 0x0071, 7}, { 0x00D7, 10},
-{ 0x09BF, 12}, { 0x0007, 8}, { 0x00AF, 10}, { 0x04CC, 11}, { 0x0034, 8}, { 0x0265, 10},
-{ 0x009F, 12}, { 0x00E0, 8}, { 0x0016, 11}, { 0x0327, 12}, { 0x0015, 9}, { 0x017D, 11},
-{ 0x0EBB, 12}, { 0x0014, 9}, { 0x00F6, 10}, { 0x01E4, 11}, { 0x00CB, 10}, { 0x099D, 12},
-{ 0x00CA, 10}, { 0x02FC, 12}, { 0x017F, 11}, { 0x04CD, 11}, { 0x02FD, 12}, { 0x04FE, 11},
-{ 0x013A, 13}, { 0x000A, 4}, { 0x0042, 7}, { 0x01D3, 9}, { 0x04DD, 11}, { 0x0012, 5},
-{ 0x00E8, 8}, { 0x004C, 11}, { 0x0136, 13}, { 0x0039, 6}, { 0x0264, 10}, { 0x0EBA, 12},
-{ 0x0000, 7}, { 0x00AE, 10}, { 0x099C, 12}, { 0x001F, 7}, { 0x04DE, 11}, { 0x0043, 7},
-{ 0x04DC, 11}, { 0x0003, 8}, { 0x03CB, 12}, { 0x0006, 8}, { 0x099E, 12}, { 0x002A, 8},
-{ 0x05F1, 13}, { 0x000F, 8}, { 0x09FE, 12}, { 0x0033, 8}, { 0x09FF, 12}, { 0x0098, 8},
-{ 0x099F, 12}, { 0x00EA, 8}, { 0x013C, 13}, { 0x002E, 8}, { 0x0192, 11}, { 0x0136, 9},
-{ 0x006A, 9}, { 0x0015, 11}, { 0x03AF, 10}, { 0x01E3, 11}, { 0x0074, 11}, { 0x00EB, 12},
-{ 0x02F9, 12}, { 0x005C, 13}, { 0x00ED, 12}, { 0x03DD, 12}, { 0x0326, 12}, { 0x005E, 13},
-{ 0x0016, 7}
-},
-{
-{ 0x0004, 3}, { 0x0014, 5}, { 0x0017, 7}, { 0x007F, 8}, { 0x0154, 9}, { 0x01F2, 10},
-{ 0x00BF, 11}, { 0x0065, 12}, { 0x0AAA, 12}, { 0x0630, 13}, { 0x1597, 13}, { 0x03B7, 14},
-{ 0x2B22, 14}, { 0x0BE6, 15}, { 0x000B, 4}, { 0x0037, 7}, { 0x0062, 9}, { 0x0007, 11},
-{ 0x0166, 12}, { 0x00CE, 13}, { 0x1590, 13}, { 0x05F6, 14}, { 0x0BE7, 15}, { 0x0007, 5},
-{ 0x006D, 8}, { 0x0003, 11}, { 0x031F, 12}, { 0x05F2, 14}, { 0x0002, 6}, { 0x0061, 9},
-{ 0x0055, 12}, { 0x01DF, 14}, { 0x001A, 6}, { 0x001E, 10}, { 0x0AC9, 12}, { 0x2B23, 14},
-{ 0x001E, 6}, { 0x001F, 10}, { 0x0AC3, 12}, { 0x2B2B, 14}, { 0x0006, 7}, { 0x0004, 11},
-{ 0x02F8, 13}, { 0x0019, 7}, { 0x0006, 11}, { 0x063D, 13}, { 0x0057, 7}, { 0x0182, 11},
-{ 0x2AA2, 14}, { 0x0004, 8}, { 0x0180, 11}, { 0x059C, 14}, { 0x007D, 8}, { 0x0164, 12},
-{ 0x076D, 15}, { 0x0002, 9}, { 0x018D, 11}, { 0x1581, 13}, { 0x00AD, 8}, { 0x0060, 12},
-{ 0x0C67, 14}, { 0x001C, 9}, { 0x00EE, 13}, { 0x0003, 9}, { 0x02CF, 13}, { 0x00D9, 9},
-{ 0x1580, 13}, { 0x0002, 11}, { 0x0183, 11}, { 0x0057, 12}, { 0x0061, 12}, { 0x0031, 11},
-{ 0x0066, 12}, { 0x0631, 13}, { 0x0632, 13}, { 0x00AC, 13}, { 0x031D, 12}, { 0x0076, 12},
-{ 0x003A, 11}, { 0x0165, 12}, { 0x0C66, 14}, { 0x0003, 2}, { 0x0054, 7}, { 0x02AB, 10},
-{ 0x0016, 13}, { 0x05F7, 14}, { 0x0005, 4}, { 0x00F8, 9}, { 0x0AA9, 12}, { 0x005F, 15},
-{ 0x0004, 4}, { 0x001C, 10}, { 0x1550, 13}, { 0x0004, 5}, { 0x0077, 11}, { 0x076C, 15},
-{ 0x000E, 5}, { 0x000A, 12}, { 0x000C, 5}, { 0x0562, 11}, { 0x0004, 6}, { 0x031C, 12},
-{ 0x0006, 6}, { 0x00C8, 13}, { 0x000D, 6}, { 0x01DA, 13}, { 0x0007, 6}, { 0x00C9, 13},
-{ 0x0001, 7}, { 0x002E, 14}, { 0x0014, 7}, { 0x1596, 13}, { 0x000A, 7}, { 0x0AC2, 12},
-{ 0x0016, 7}, { 0x015B, 14}, { 0x0015, 7}, { 0x015A, 14}, { 0x000F, 8}, { 0x005E, 15},
-{ 0x007E, 8}, { 0x00AB, 8}, { 0x002D, 9}, { 0x00D8, 9}, { 0x000B, 9}, { 0x0014, 10},
-{ 0x02B3, 10}, { 0x01F3, 10}, { 0x003A, 10}, { 0x0000, 10}, { 0x0058, 10}, { 0x002E, 9},
-{ 0x005E, 10}, { 0x0563, 11}, { 0x00EC, 12}, { 0x0054, 12}, { 0x0AC1, 12}, { 0x1556, 13},
-{ 0x02FA, 13}, { 0x0181, 11}, { 0x1557, 13}, { 0x059D, 14}, { 0x2AA3, 14}, { 0x2B2A, 14},
-{ 0x01DE, 14}, { 0x063C, 13}, { 0x00CF, 13}, { 0x1594, 13}, { 0x000D, 9}
-},
-{
-{ 0x0002, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x000D, 5}, { 0x000C, 5}, { 0x0015, 6},
-{ 0x0013, 6}, { 0x0012, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x001E, 8}, { 0x001D, 8},
-{ 0x0025, 9}, { 0x0024, 9}, { 0x0023, 9}, { 0x0021, 9}, { 0x0021, 10}, { 0x0020, 10},
-{ 0x000F, 10}, { 0x000E, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11}, { 0x0021, 11},
-{ 0x0050, 12}, { 0x0051, 12}, { 0x0052, 12}, { 0x000E, 4}, { 0x0014, 6}, { 0x0016, 7},
-{ 0x001C, 8}, { 0x0020, 9}, { 0x001F, 9}, { 0x000D, 10}, { 0x0022, 11}, { 0x0053, 12},
-{ 0x0055, 12}, { 0x000B, 5}, { 0x0015, 7}, { 0x001E, 9}, { 0x000C, 10}, { 0x0056, 12},
-{ 0x0011, 6}, { 0x001B, 8}, { 0x001D, 9}, { 0x000B, 10}, { 0x0010, 6}, { 0x0022, 9},
-{ 0x000A, 10}, { 0x000D, 6}, { 0x001C, 9}, { 0x0008, 10}, { 0x0012, 7}, { 0x001B, 9},
-{ 0x0054, 12}, { 0x0014, 7}, { 0x001A, 9}, { 0x0057, 12}, { 0x0019, 8}, { 0x0009, 10},
-{ 0x0018, 8}, { 0x0023, 11}, { 0x0017, 8}, { 0x0019, 9}, { 0x0018, 9}, { 0x0007, 10},
-{ 0x0058, 12}, { 0x0007, 4}, { 0x000C, 6}, { 0x0016, 8}, { 0x0017, 9}, { 0x0006, 10},
-{ 0x0005, 11}, { 0x0004, 11}, { 0x0059, 12}, { 0x000F, 6}, { 0x0016, 9}, { 0x0005, 10},
-{ 0x000E, 6}, { 0x0004, 10}, { 0x0011, 7}, { 0x0024, 11}, { 0x0010, 7}, { 0x0025, 11},
-{ 0x0013, 7}, { 0x005A, 12}, { 0x0015, 8}, { 0x005B, 12}, { 0x0014, 8}, { 0x0013, 8},
-{ 0x001A, 8}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9}, { 0x0012, 9}, { 0x0011, 9},
-{ 0x0026, 11}, { 0x0027, 11}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12},
-{ 0x0003, 7}
-},
-{
-{ 0x0002, 2}, { 0x000F, 4}, { 0x0015, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x0025, 9},
-{ 0x0024, 9}, { 0x0021, 10}, { 0x0020, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11},
-{ 0x0006, 3}, { 0x0014, 6}, { 0x001E, 8}, { 0x000F, 10}, { 0x0021, 11}, { 0x0050, 12},
-{ 0x000E, 4}, { 0x001D, 8}, { 0x000E, 10}, { 0x0051, 12}, { 0x000D, 5}, { 0x0023, 9},
-{ 0x000D, 10}, { 0x000C, 5}, { 0x0022, 9}, { 0x0052, 12}, { 0x000B, 5}, { 0x000C, 10},
-{ 0x0053, 12}, { 0x0013, 6}, { 0x000B, 10}, { 0x0054, 12}, { 0x0012, 6}, { 0x000A, 10},
-{ 0x0011, 6}, { 0x0009, 10}, { 0x0010, 6}, { 0x0008, 10}, { 0x0016, 7}, { 0x0055, 12},
-{ 0x0015, 7}, { 0x0014, 7}, { 0x001C, 8}, { 0x001B, 8}, { 0x0021, 9}, { 0x0020, 9},
-{ 0x001F, 9}, { 0x001E, 9}, { 0x001D, 9}, { 0x001C, 9}, { 0x001B, 9}, { 0x001A, 9},
-{ 0x0022, 11}, { 0x0023, 11}, { 0x0056, 12}, { 0x0057, 12}, { 0x0007, 4}, { 0x0019, 9},
-{ 0x0005, 11}, { 0x000F, 6}, { 0x0004, 11}, { 0x000E, 6}, { 0x000D, 6}, { 0x000C, 6},
-{ 0x0013, 7}, { 0x0012, 7}, { 0x0011, 7}, { 0x0010, 7}, { 0x001A, 8}, { 0x0019, 8},
-{ 0x0018, 8}, { 0x0017, 8}, { 0x0016, 8}, { 0x0015, 8}, { 0x0014, 8}, { 0x0013, 8},
-{ 0x0018, 9}, { 0x0017, 9}, { 0x0016, 9}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9},
-{ 0x0012, 9}, { 0x0011, 9}, { 0x0007, 10}, { 0x0006, 10}, { 0x0005, 10}, { 0x0004, 10},
-{ 0x0024, 11}, { 0x0025, 11}, { 0x0026, 11}, { 0x0027, 11}, { 0x0058, 12}, { 0x0059, 12},
-{ 0x005A, 12}, { 0x005B, 12}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12},
-{ 0x0003, 7}
-},
-{
-{ 0x0000, 2}, { 0x0003, 3}, { 0x000D, 4}, { 0x0005, 4}, { 0x001C, 5}, { 0x0016, 5},
-{ 0x003F, 6}, { 0x003A, 6}, { 0x002E, 6}, { 0x0022, 6}, { 0x007B, 7}, { 0x0067, 7},
-{ 0x005F, 7}, { 0x0047, 7}, { 0x0026, 7}, { 0x00EF, 8}, { 0x00CD, 8}, { 0x00C1, 8},
-{ 0x00A9, 8}, { 0x004F, 8}, { 0x01F2, 9}, { 0x01DD, 9}, { 0x0199, 9}, { 0x0185, 9},
-{ 0x015D, 9}, { 0x011B, 9}, { 0x03EF, 10}, { 0x03E1, 10}, { 0x03C8, 10}, { 0x0331, 10},
-{ 0x0303, 10}, { 0x02F1, 10}, { 0x02A0, 10}, { 0x0233, 10}, { 0x0126, 10}, { 0x07C0, 11},
-{ 0x076F, 11}, { 0x076C, 11}, { 0x0661, 11}, { 0x0604, 11}, { 0x0572, 11}, { 0x0551, 11},
-{ 0x046A, 11}, { 0x0274, 11}, { 0x0F27, 12}, { 0x0F24, 12}, { 0x0EDB, 12}, { 0x0C8E, 12},
-{ 0x0C0B, 12}, { 0x0C0A, 12}, { 0x0AE3, 12}, { 0x08D6, 12}, { 0x0490, 12}, { 0x0495, 12},
-{ 0x1F19, 13}, { 0x1DB5, 13}, { 0x0009, 4}, { 0x0010, 5}, { 0x0029, 6}, { 0x0062, 7},
-{ 0x00F3, 8}, { 0x00AD, 8}, { 0x01E5, 9}, { 0x0179, 9}, { 0x009C, 9}, { 0x03B1, 10},
-{ 0x02AE, 10}, { 0x0127, 10}, { 0x076E, 11}, { 0x0570, 11}, { 0x0275, 11}, { 0x0F25, 12},
-{ 0x0EC0, 12}, { 0x0AA0, 12}, { 0x08D7, 12}, { 0x1E4C, 13}, { 0x0008, 5}, { 0x0063, 7},
-{ 0x00AF, 8}, { 0x017B, 9}, { 0x03B3, 10}, { 0x07DD, 11}, { 0x0640, 11}, { 0x0F8D, 12},
-{ 0x0BC1, 12}, { 0x0491, 12}, { 0x0028, 6}, { 0x00C3, 8}, { 0x0151, 9}, { 0x02A1, 10},
-{ 0x0573, 11}, { 0x0EC3, 12}, { 0x1F35, 13}, { 0x0065, 7}, { 0x01DA, 9}, { 0x02AF, 10},
-{ 0x0277, 11}, { 0x08C9, 12}, { 0x1781, 13}, { 0x0025, 7}, { 0x0118, 9}, { 0x0646, 11},
-{ 0x0AA6, 12}, { 0x1780, 13}, { 0x00C9, 8}, { 0x0321, 10}, { 0x0F9B, 12}, { 0x191E, 13},
-{ 0x0048, 8}, { 0x07CC, 11}, { 0x0AA1, 12}, { 0x0180, 9}, { 0x0465, 11}, { 0x1905, 13},
-{ 0x03E2, 10}, { 0x0EC1, 12}, { 0x3C9B, 14}, { 0x02F4, 10}, { 0x08C8, 12}, { 0x07C1, 11},
-{ 0x0928, 13}, { 0x05E1, 11}, { 0x320D, 14}, { 0x0EC2, 12}, { 0x6418, 15}, { 0x1F34, 13},
-{ 0x0078, 7}, { 0x0155, 9}, { 0x0552, 11}, { 0x191F, 13}, { 0x00FA, 8}, { 0x07DC, 11},
-{ 0x1907, 13}, { 0x00AC, 8}, { 0x0249, 11}, { 0x13B1, 14}, { 0x01F6, 9}, { 0x0AE2, 12},
-{ 0x01DC, 9}, { 0x04ED, 12}, { 0x0184, 9}, { 0x1904, 13}, { 0x0156, 9}, { 0x09D9, 13},
-{ 0x03E7, 10}, { 0x0929, 13}, { 0x03B2, 10}, { 0x3B68, 14}, { 0x02F5, 10}, { 0x13B0, 14},
-{ 0x0322, 10}, { 0x3B69, 14}, { 0x0234, 10}, { 0x7935, 15}, { 0x07C7, 11}, { 0xC833, 16},
-{ 0x0660, 11}, { 0x7934, 15}, { 0x024B, 11}, { 0xC832, 16}, { 0x0AA7, 12}, { 0x1F18, 13},
-{ 0x007A, 7}
-},
-{
-{ 0x0002, 2}, { 0x0000, 3}, { 0x001E, 5}, { 0x0004, 5}, { 0x0012, 6}, { 0x0070, 7},
-{ 0x001A, 7}, { 0x005F, 8}, { 0x0047, 8}, { 0x01D3, 9}, { 0x00B5, 9}, { 0x0057, 9},
-{ 0x03B5, 10}, { 0x016D, 10}, { 0x0162, 10}, { 0x07CE, 11}, { 0x0719, 11}, { 0x0691, 11},
-{ 0x02C6, 11}, { 0x0156, 11}, { 0x0F92, 12}, { 0x0D2E, 12}, { 0x0D20, 12}, { 0x059E, 12},
-{ 0x0468, 12}, { 0x02A6, 12}, { 0x1DA2, 13}, { 0x1C60, 13}, { 0x1A43, 13}, { 0x0B1D, 13},
-{ 0x08C0, 13}, { 0x055D, 13}, { 0x0003, 3}, { 0x000A, 5}, { 0x0077, 7}, { 0x00E5, 8},
-{ 0x01D9, 9}, { 0x03E5, 10}, { 0x0166, 10}, { 0x0694, 11}, { 0x0152, 11}, { 0x059F, 12},
-{ 0x1F3C, 13}, { 0x1A4B, 13}, { 0x055E, 13}, { 0x000C, 4}, { 0x007D, 7}, { 0x0044, 8},
-{ 0x03E0, 10}, { 0x0769, 11}, { 0x0E31, 12}, { 0x1F26, 13}, { 0x055C, 13}, { 0x001B, 5},
-{ 0x00E2, 8}, { 0x03A5, 10}, { 0x02C9, 11}, { 0x1F23, 13}, { 0x3B47, 14}, { 0x0007, 5},
-{ 0x01D8, 9}, { 0x02D8, 11}, { 0x1F27, 13}, { 0x3494, 14}, { 0x0035, 6}, { 0x03E1, 10},
-{ 0x059C, 12}, { 0x38C3, 14}, { 0x000C, 6}, { 0x0165, 10}, { 0x1D23, 13}, { 0x1638, 14},
-{ 0x0068, 7}, { 0x0693, 11}, { 0x3A45, 14}, { 0x0020, 7}, { 0x0F90, 12}, { 0x7CF6, 15},
-{ 0x00E8, 8}, { 0x058F, 12}, { 0x2CEF, 15}, { 0x0045, 8}, { 0x0B3A, 13}, { 0x01F1, 9},
-{ 0x3B46, 14}, { 0x01A7, 9}, { 0x1676, 14}, { 0x0056, 9}, { 0x692A, 15}, { 0x038D, 10},
-{ 0xE309, 16}, { 0x00AA, 10}, { 0x1C611, 17}, { 0x02DF, 11}, { 0xB3B9, 17}, { 0x02C8, 11},
-{ 0x38C20, 18}, { 0x01B0, 11}, { 0x16390, 18}, { 0x0F9F, 12}, { 0x16771, 18}, { 0x0ED0, 12},
-{ 0x71843, 19}, { 0x0D2A, 12}, { 0xF9E8C, 20}, { 0x0461, 12}, { 0xF9E8E, 20}, { 0x0B67, 13},
-{ 0x055F, 13}, { 0x003F, 6}, { 0x006D, 9}, { 0x0E90, 12}, { 0x054E, 13}, { 0x0013, 6},
-{ 0x0119, 10}, { 0x0B66, 13}, { 0x000B, 6}, { 0x0235, 11}, { 0x7CF5, 15}, { 0x0075, 7},
-{ 0x0D24, 12}, { 0xF9E9, 16}, { 0x002E, 7}, { 0x1F22, 13}, { 0x0021, 7}, { 0x054F, 13},
-{ 0x0014, 7}, { 0x3A44, 14}, { 0x00E4, 8}, { 0x7CF7, 15}, { 0x005E, 8}, { 0x7185, 15},
-{ 0x0037, 8}, { 0x2C73, 15}, { 0x01DB, 9}, { 0x59DD, 16}, { 0x01C7, 9}, { 0x692B, 15},
-{ 0x01A6, 9}, { 0x58E5, 16}, { 0x00B4, 9}, { 0x1F3D0, 17}, { 0x00B0, 9}, { 0xB1C9, 17},
-{ 0x03E6, 10}, { 0x16770, 18}, { 0x016E, 10}, { 0x3E7A2, 18}, { 0x011B, 10}, { 0xF9E8D, 20},
-{ 0x00D9, 10}, { 0xF9E8F, 20}, { 0x00A8, 10}, { 0x2C723, 19}, { 0x0749, 11}, { 0xE3084, 20},
-{ 0x0696, 11}, { 0x58E45, 20}, { 0x02DE, 11}, { 0xB1C88, 21}, { 0x0231, 11}, { 0x1C610A, 21},
-{ 0x01B1, 11}, { 0x71842D, 23}, { 0x0D2B, 12}, { 0x38C217, 22}, { 0x0D2F, 12}, { 0x163913, 22},
-{ 0x05B2, 12}, { 0x163912, 22}, { 0x0469, 12}, { 0x71842C, 23}, { 0x1A42, 13}, { 0x08C1, 13},
-{ 0x0073, 7}
-}
-};
-
-static const uint16_t vlc_offs[] = {
- 0, 520, 552, 616, 1128, 1160, 1224, 1740, 1772, 1836, 1900, 2436,
- 2986, 3050, 3610, 4154, 4218, 4746, 5326, 5390, 5902, 6554, 7658, 8342,
- 9304, 9988, 10630, 11234, 12174, 13006, 13560, 14232, 14786, 15432, 16350, 17522,
- 20372, 21818, 22330, 22394, 23166, 23678, 23742, 24820, 25332, 25396, 26460, 26980,
- 27048, 27592, 27600, 27608, 27616, 27624, 28224, 28258, 28290, 28802, 28834, 28866,
- 29378, 29412, 29444, 29960, 29994, 30026, 30538, 30572, 30604, 31120, 31154, 31186,
- 31714, 31746, 31778, 32306, 32340, 32372
-};
-
-static av_cold void vc1_init_static(void)
-{
- static VLCElem vlc_table[32372];
-
- INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
- vc1_norm2_bits, 1, 1,
- vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS);
- INIT_VLC_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64,
- vc1_norm6_bits, 1, 1,
- vc1_norm6_codes, 2, 2, 556);
- INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7,
- vc1_imode_bits, 1, 1,
- vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS);
- for (int i = 0; i < 3; i++) {
- ff_vc1_ttmb_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 0]];
- ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0];
- init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16,
- vc1_ttmb_bits[i], 1, 1,
- vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
- ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]];
- ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1];
- init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8,
- vc1_ttblk_bits[i], 1, 1,
- vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
- ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]];
- ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2];
- init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15,
- vc1_subblkpat_bits[i], 1, 1,
- vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
- }
- for (int i = 0; i < 4; i++) {
- ff_vc1_4mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 9]];
- ff_vc1_4mv_block_pattern_vlc[i].table_allocated = vlc_offs[i * 3 + 10] - vlc_offs[i * 3 + 9];
- init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16,
- vc1_4mv_block_pattern_bits[i], 1, 1,
- vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
- ff_vc1_cbpcy_p_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 10]];
- ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10];
- init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64,
- vc1_cbpcy_p_bits[i], 1, 1,
- vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
- ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]];
- ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11];
- init_vlc(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73,
- vc1_mv_diff_bits[i], 1, 1,
- vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
- }
- for (int i = 0; i < 8; i++) {
- ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]];
- ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i * 2 + 22] - vlc_offs[i * 2 + 21];
- init_vlc(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i],
- &vc1_ac_tables[i][0][1], 8, 4,
- &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_STATIC);
- /* initialize interlaced MVDATA tables (2-Ref) */
- ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]];
- ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22];
- init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126,
- vc1_2ref_mvdata_bits[i], 1, 1,
- vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
- }
- for (int i = 0; i < 4; i++) {
- /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */
- ff_vc1_intfr_4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 37]];
- ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37];
- init_vlc(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15,
- vc1_intfr_4mv_mbmode_bits[i], 1, 1,
- vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
- /* initialize NON-4MV MBMODE VLC tables for the same */
- ff_vc1_intfr_non4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 38]];
- ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38];
- init_vlc(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9,
- vc1_intfr_non4mv_mbmode_bits[i], 1, 1,
- vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
- /* initialize interlaced MVDATA tables (1-Ref) */
- ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]];
- ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39];
- init_vlc(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72,
- vc1_1ref_mvdata_bits[i], 1, 1,
- vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
- }
- for (int i = 0; i < 4; i++) {
- /* Initialize 2MV Block pattern VLC tables */
- ff_vc1_2mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i + 49]];
- ff_vc1_2mv_block_pattern_vlc[i].table_allocated = vlc_offs[i + 50] - vlc_offs[i + 49];
- init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4,
- vc1_2mv_block_pattern_bits[i], 1, 1,
- vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
- }
- for (int i = 0; i < 8; i++) {
- /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */
- ff_vc1_icbpcy_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 53]];
- ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53];
- init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63,
- vc1_icbpcy_p_bits[i], 1, 1,
- vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
- /* Initialize interlaced field picture MBMODE VLC tables */
- ff_vc1_if_mmv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 54]];
- ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54];
- init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8,
- vc1_if_mmv_mbmode_bits[i], 1, 1,
- vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
- ff_vc1_if_1mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 55]];
- ff_vc1_if_1mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 56] - vlc_offs[i * 3 + 55];
- init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6,
- vc1_if_1mv_mbmode_bits[i], 1, 1,
- vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
- }
-}
-
-/**
- * Init VC-1 specific tables and VC1Context members
- * @param v The VC1Context to initialize
- * @return Status
- */
-av_cold void ff_vc1_init_common(VC1Context *v)
-{
- static AVOnce init_static_once = AV_ONCE_INIT;
-
- /* defaults */
- v->pq = -1;
- v->mvrange = 0; /* 7.1.1.18, p80 */
-
- ff_vc1dsp_init(&v->vc1dsp);
-
- /* VLC tables */
- ff_thread_once(&init_static_once, vc1_init_static);
-}
diff --git a/libavcodec/vc1_vlc_data.h b/libavcodec/vc1_vlc_data.h
index 2063269a24..2cd227b182 100644
--- a/libavcodec/vc1_vlc_data.h
+++ b/libavcodec/vc1_vlc_data.h
@@ -835,6 +835,227 @@ static const uint8_t vc1_mv_diff_bits[4][73] = {
}
};
+static const uint32_t vc1_ac_tables[AC_MODES][186][2] = {
+{
+{ 0x0001, 2}, { 0x0005, 3}, { 0x000D, 4}, { 0x0012, 5}, { 0x000E, 6}, { 0x0015, 7},
+{ 0x0013, 8}, { 0x003F, 8}, { 0x004B, 9}, { 0x011F, 9}, { 0x00B8, 10}, { 0x03E3, 10},
+{ 0x0172, 11}, { 0x024D, 12}, { 0x03DA, 12}, { 0x02DD, 13}, { 0x1F55, 13}, { 0x05B9, 14},
+{ 0x3EAE, 14}, { 0x0000, 4}, { 0x0010, 5}, { 0x0008, 7}, { 0x0020, 8}, { 0x0029, 9},
+{ 0x01F4, 9}, { 0x0233, 10}, { 0x01E0, 11}, { 0x012A, 12}, { 0x03DD, 12}, { 0x050A, 13},
+{ 0x1F29, 13}, { 0x0A42, 14}, { 0x1272, 15}, { 0x1737, 15}, { 0x0003, 5}, { 0x0011, 7},
+{ 0x00C4, 8}, { 0x004B, 10}, { 0x00B4, 11}, { 0x07D4, 11}, { 0x0345, 12}, { 0x02D7, 13},
+{ 0x07BF, 13}, { 0x0938, 14}, { 0x0BBB, 14}, { 0x095E, 15}, { 0x0013, 5}, { 0x0078, 7},
+{ 0x0069, 9}, { 0x0232, 10}, { 0x0461, 11}, { 0x03EC, 12}, { 0x0520, 13}, { 0x1F2A, 13},
+{ 0x3E50, 14}, { 0x3E51, 14}, { 0x1486, 15}, { 0x000C, 6}, { 0x0024, 9}, { 0x0094, 11},
+{ 0x08C0, 12}, { 0x0F09, 14}, { 0x1EF0, 15}, { 0x003D, 6}, { 0x0053, 9}, { 0x01A0, 11},
+{ 0x02D6, 13}, { 0x0F08, 14}, { 0x0013, 7}, { 0x007C, 9}, { 0x07C1, 11}, { 0x04AC, 14},
+{ 0x001B, 7}, { 0x00A0, 10}, { 0x0344, 12}, { 0x0F79, 14}, { 0x0079, 7}, { 0x03E1, 10},
+{ 0x02D4, 13}, { 0x2306, 14}, { 0x0021, 8}, { 0x023C, 10}, { 0x0FAE, 12}, { 0x23DE, 14},
+{ 0x0035, 8}, { 0x0175, 11}, { 0x07B3, 13}, { 0x00C5, 8}, { 0x0174, 11}, { 0x0785, 13},
+{ 0x0048, 9}, { 0x01A3, 11}, { 0x049E, 13}, { 0x002C, 9}, { 0x00FA, 10}, { 0x07D6, 11},
+{ 0x0092, 10}, { 0x05CC, 13}, { 0x1EF1, 15}, { 0x00A3, 10}, { 0x03ED, 12}, { 0x093E, 14},
+{ 0x01E2, 11}, { 0x1273, 15}, { 0x07C4, 11}, { 0x1487, 15}, { 0x0291, 12}, { 0x0293, 12},
+{ 0x0F8A, 12}, { 0x0509, 13}, { 0x0508, 13}, { 0x078D, 13}, { 0x07BE, 13}, { 0x078C, 13},
+{ 0x04AE, 14}, { 0x0BBA, 14}, { 0x2307, 14}, { 0x0B9A, 14}, { 0x1736, 15}, { 0x000E, 4},
+{ 0x0045, 7}, { 0x01F3, 9}, { 0x047A, 11}, { 0x05DC, 13}, { 0x23DF, 14}, { 0x0019, 5},
+{ 0x0028, 9}, { 0x0176, 11}, { 0x049D, 13}, { 0x23DD, 14}, { 0x0030, 6}, { 0x00A2, 10},
+{ 0x02EF, 12}, { 0x05B8, 14}, { 0x003F, 6}, { 0x00A5, 10}, { 0x03DB, 12}, { 0x093F, 14},
+{ 0x0044, 7}, { 0x07CB, 11}, { 0x095F, 15}, { 0x0063, 7}, { 0x03C3, 12}, { 0x0015, 8},
+{ 0x08F6, 12}, { 0x0017, 8}, { 0x0498, 13}, { 0x002C, 8}, { 0x07B2, 13}, { 0x002F, 8},
+{ 0x1F54, 13}, { 0x008D, 8}, { 0x07BD, 13}, { 0x008E, 8}, { 0x1182, 13}, { 0x00FB, 8},
+{ 0x050B, 13}, { 0x002D, 8}, { 0x07C0, 11}, { 0x0079, 9}, { 0x1F5F, 13}, { 0x007A, 9},
+{ 0x1F56, 13}, { 0x0231, 10}, { 0x03E4, 10}, { 0x01A1, 11}, { 0x0143, 11}, { 0x01F7, 11},
+{ 0x016F, 12}, { 0x0292, 12}, { 0x02E7, 12}, { 0x016C, 12}, { 0x016D, 12}, { 0x03DC, 12},
+{ 0x0F8B, 12}, { 0x0499, 13}, { 0x03D8, 12}, { 0x078E, 13}, { 0x02D5, 13}, { 0x1F5E, 13},
+{ 0x1F2B, 13}, { 0x078F, 13}, { 0x04AD, 14}, { 0x3EAF, 14}, { 0x23DC, 14}, { 0x004A, 9}
+},
+{
+{ 0x0000, 3}, { 0x0003, 4}, { 0x000B, 5}, { 0x0014, 6}, { 0x003F, 6}, { 0x005D, 7},
+{ 0x00A2, 8}, { 0x00AC, 9}, { 0x016E, 9}, { 0x020A, 10}, { 0x02E2, 10}, { 0x0432, 11},
+{ 0x05C9, 11}, { 0x0827, 12}, { 0x0B54, 12}, { 0x04E6, 13}, { 0x105F, 13}, { 0x172A, 13},
+{ 0x20B2, 14}, { 0x2D4E, 14}, { 0x39F0, 14}, { 0x4175, 15}, { 0x5A9E, 15}, { 0x0004, 4},
+{ 0x001E, 5}, { 0x0042, 7}, { 0x00B6, 8}, { 0x0173, 9}, { 0x0395, 10}, { 0x072E, 11},
+{ 0x0B94, 12}, { 0x16A4, 13}, { 0x20B3, 14}, { 0x2E45, 14}, { 0x0005, 5}, { 0x0040, 7},
+{ 0x0049, 9}, { 0x028F, 10}, { 0x05CB, 11}, { 0x048A, 13}, { 0x09DD, 14}, { 0x73E2, 15},
+{ 0x0018, 5}, { 0x0025, 8}, { 0x008A, 10}, { 0x051B, 11}, { 0x0E5F, 12}, { 0x09C9, 14},
+{ 0x139C, 15}, { 0x0029, 6}, { 0x004F, 9}, { 0x0412, 11}, { 0x048D, 13}, { 0x2E41, 14},
+{ 0x0038, 6}, { 0x010E, 9}, { 0x05A8, 11}, { 0x105C, 13}, { 0x39F2, 14}, { 0x0058, 7},
+{ 0x021F, 10}, { 0x0E7E, 12}, { 0x39FF, 14}, { 0x0023, 8}, { 0x02E3, 10}, { 0x04E5, 13},
+{ 0x2E40, 14}, { 0x00A1, 8}, { 0x05BE, 11}, { 0x09C8, 14}, { 0x0083, 8}, { 0x013A, 11},
+{ 0x1721, 13}, { 0x0044, 9}, { 0x0276, 12}, { 0x39F6, 14}, { 0x008B, 10}, { 0x04EF, 13},
+{ 0x5A9B, 15}, { 0x0208, 10}, { 0x1CFE, 13}, { 0x0399, 10}, { 0x1CB4, 13}, { 0x039E, 10},
+{ 0x39F3, 14}, { 0x05AB, 11}, { 0x73E3, 15}, { 0x0737, 11}, { 0x5A9F, 15}, { 0x082D, 12},
+{ 0x0E69, 12}, { 0x0E68, 12}, { 0x0433, 11}, { 0x0B7B, 12}, { 0x2DF8, 14}, { 0x2E56, 14},
+{ 0x2E57, 14}, { 0x39F7, 14}, { 0x51A5, 15}, { 0x0003, 3}, { 0x002A, 6}, { 0x00E4, 8},
+{ 0x028E, 10}, { 0x0735, 11}, { 0x1058, 13}, { 0x1CFA, 13}, { 0x2DF9, 14}, { 0x4174, 15},
+{ 0x0009, 4}, { 0x0054, 8}, { 0x0398, 10}, { 0x048B, 13}, { 0x139D, 15}, { 0x000D, 4},
+{ 0x00AD, 9}, { 0x0826, 12}, { 0x2D4C, 14}, { 0x0011, 5}, { 0x016B, 9}, { 0x0B7F, 12},
+{ 0x51A4, 15}, { 0x0019, 5}, { 0x021B, 10}, { 0x16FD, 13}, { 0x001D, 5}, { 0x0394, 10},
+{ 0x28D3, 14}, { 0x002B, 6}, { 0x05BC, 11}, { 0x5A9A, 15}, { 0x002F, 6}, { 0x0247, 12},
+{ 0x0010, 7}, { 0x0A35, 12}, { 0x003E, 6}, { 0x0B7A, 12}, { 0x0059, 7}, { 0x105E, 13},
+{ 0x0026, 8}, { 0x09CF, 14}, { 0x0055, 8}, { 0x1CB5, 13}, { 0x0057, 8}, { 0x0E5B, 12},
+{ 0x00A0, 8}, { 0x1468, 13}, { 0x0170, 9}, { 0x0090, 10}, { 0x01CE, 9}, { 0x021A, 10},
+{ 0x0218, 10}, { 0x0168, 9}, { 0x021E, 10}, { 0x0244, 12}, { 0x0736, 11}, { 0x0138, 11},
+{ 0x0519, 11}, { 0x0E5E, 12}, { 0x072C, 11}, { 0x0B55, 12}, { 0x09DC, 14}, { 0x20BB, 14},
+{ 0x048C, 13}, { 0x1723, 13}, { 0x2E44, 14}, { 0x16A5, 13}, { 0x0518, 11}, { 0x39FE, 14},
+{ 0x0169, 9}
+},
+{
+{ 0x0001, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x0016, 5}, { 0x0020, 6}, { 0x0018, 7},
+{ 0x0008, 8}, { 0x009A, 8}, { 0x0056, 9}, { 0x013E, 9}, { 0x00F0, 10}, { 0x03A5, 10},
+{ 0x0077, 11}, { 0x01EF, 11}, { 0x009A, 12}, { 0x005D, 13}, { 0x0001, 4}, { 0x0011, 5},
+{ 0x0002, 7}, { 0x000B, 8}, { 0x0012, 9}, { 0x01D6, 9}, { 0x027E, 10}, { 0x0191, 11},
+{ 0x00EA, 12}, { 0x03DC, 12}, { 0x013B, 13}, { 0x0004, 5}, { 0x0014, 7}, { 0x009E, 8},
+{ 0x0009, 10}, { 0x01AC, 11}, { 0x01E2, 11}, { 0x03CA, 12}, { 0x005F, 13}, { 0x0017, 5},
+{ 0x004E, 7}, { 0x005E, 9}, { 0x00F3, 10}, { 0x01AD, 11}, { 0x00EC, 12}, { 0x05F0, 13},
+{ 0x000E, 6}, { 0x00E1, 8}, { 0x03A4, 10}, { 0x009C, 12}, { 0x013D, 13}, { 0x003B, 6},
+{ 0x001C, 9}, { 0x0014, 11}, { 0x09BE, 12}, { 0x0006, 7}, { 0x007A, 9}, { 0x0190, 11},
+{ 0x0137, 13}, { 0x001B, 7}, { 0x0008, 10}, { 0x075C, 11}, { 0x0071, 7}, { 0x00D7, 10},
+{ 0x09BF, 12}, { 0x0007, 8}, { 0x00AF, 10}, { 0x04CC, 11}, { 0x0034, 8}, { 0x0265, 10},
+{ 0x009F, 12}, { 0x00E0, 8}, { 0x0016, 11}, { 0x0327, 12}, { 0x0015, 9}, { 0x017D, 11},
+{ 0x0EBB, 12}, { 0x0014, 9}, { 0x00F6, 10}, { 0x01E4, 11}, { 0x00CB, 10}, { 0x099D, 12},
+{ 0x00CA, 10}, { 0x02FC, 12}, { 0x017F, 11}, { 0x04CD, 11}, { 0x02FD, 12}, { 0x04FE, 11},
+{ 0x013A, 13}, { 0x000A, 4}, { 0x0042, 7}, { 0x01D3, 9}, { 0x04DD, 11}, { 0x0012, 5},
+{ 0x00E8, 8}, { 0x004C, 11}, { 0x0136, 13}, { 0x0039, 6}, { 0x0264, 10}, { 0x0EBA, 12},
+{ 0x0000, 7}, { 0x00AE, 10}, { 0x099C, 12}, { 0x001F, 7}, { 0x04DE, 11}, { 0x0043, 7},
+{ 0x04DC, 11}, { 0x0003, 8}, { 0x03CB, 12}, { 0x0006, 8}, { 0x099E, 12}, { 0x002A, 8},
+{ 0x05F1, 13}, { 0x000F, 8}, { 0x09FE, 12}, { 0x0033, 8}, { 0x09FF, 12}, { 0x0098, 8},
+{ 0x099F, 12}, { 0x00EA, 8}, { 0x013C, 13}, { 0x002E, 8}, { 0x0192, 11}, { 0x0136, 9},
+{ 0x006A, 9}, { 0x0015, 11}, { 0x03AF, 10}, { 0x01E3, 11}, { 0x0074, 11}, { 0x00EB, 12},
+{ 0x02F9, 12}, { 0x005C, 13}, { 0x00ED, 12}, { 0x03DD, 12}, { 0x0326, 12}, { 0x005E, 13},
+{ 0x0016, 7}
+},
+{
+{ 0x0004, 3}, { 0x0014, 5}, { 0x0017, 7}, { 0x007F, 8}, { 0x0154, 9}, { 0x01F2, 10},
+{ 0x00BF, 11}, { 0x0065, 12}, { 0x0AAA, 12}, { 0x0630, 13}, { 0x1597, 13}, { 0x03B7, 14},
+{ 0x2B22, 14}, { 0x0BE6, 15}, { 0x000B, 4}, { 0x0037, 7}, { 0x0062, 9}, { 0x0007, 11},
+{ 0x0166, 12}, { 0x00CE, 13}, { 0x1590, 13}, { 0x05F6, 14}, { 0x0BE7, 15}, { 0x0007, 5},
+{ 0x006D, 8}, { 0x0003, 11}, { 0x031F, 12}, { 0x05F2, 14}, { 0x0002, 6}, { 0x0061, 9},
+{ 0x0055, 12}, { 0x01DF, 14}, { 0x001A, 6}, { 0x001E, 10}, { 0x0AC9, 12}, { 0x2B23, 14},
+{ 0x001E, 6}, { 0x001F, 10}, { 0x0AC3, 12}, { 0x2B2B, 14}, { 0x0006, 7}, { 0x0004, 11},
+{ 0x02F8, 13}, { 0x0019, 7}, { 0x0006, 11}, { 0x063D, 13}, { 0x0057, 7}, { 0x0182, 11},
+{ 0x2AA2, 14}, { 0x0004, 8}, { 0x0180, 11}, { 0x059C, 14}, { 0x007D, 8}, { 0x0164, 12},
+{ 0x076D, 15}, { 0x0002, 9}, { 0x018D, 11}, { 0x1581, 13}, { 0x00AD, 8}, { 0x0060, 12},
+{ 0x0C67, 14}, { 0x001C, 9}, { 0x00EE, 13}, { 0x0003, 9}, { 0x02CF, 13}, { 0x00D9, 9},
+{ 0x1580, 13}, { 0x0002, 11}, { 0x0183, 11}, { 0x0057, 12}, { 0x0061, 12}, { 0x0031, 11},
+{ 0x0066, 12}, { 0x0631, 13}, { 0x0632, 13}, { 0x00AC, 13}, { 0x031D, 12}, { 0x0076, 12},
+{ 0x003A, 11}, { 0x0165, 12}, { 0x0C66, 14}, { 0x0003, 2}, { 0x0054, 7}, { 0x02AB, 10},
+{ 0x0016, 13}, { 0x05F7, 14}, { 0x0005, 4}, { 0x00F8, 9}, { 0x0AA9, 12}, { 0x005F, 15},
+{ 0x0004, 4}, { 0x001C, 10}, { 0x1550, 13}, { 0x0004, 5}, { 0x0077, 11}, { 0x076C, 15},
+{ 0x000E, 5}, { 0x000A, 12}, { 0x000C, 5}, { 0x0562, 11}, { 0x0004, 6}, { 0x031C, 12},
+{ 0x0006, 6}, { 0x00C8, 13}, { 0x000D, 6}, { 0x01DA, 13}, { 0x0007, 6}, { 0x00C9, 13},
+{ 0x0001, 7}, { 0x002E, 14}, { 0x0014, 7}, { 0x1596, 13}, { 0x000A, 7}, { 0x0AC2, 12},
+{ 0x0016, 7}, { 0x015B, 14}, { 0x0015, 7}, { 0x015A, 14}, { 0x000F, 8}, { 0x005E, 15},
+{ 0x007E, 8}, { 0x00AB, 8}, { 0x002D, 9}, { 0x00D8, 9}, { 0x000B, 9}, { 0x0014, 10},
+{ 0x02B3, 10}, { 0x01F3, 10}, { 0x003A, 10}, { 0x0000, 10}, { 0x0058, 10}, { 0x002E, 9},
+{ 0x005E, 10}, { 0x0563, 11}, { 0x00EC, 12}, { 0x0054, 12}, { 0x0AC1, 12}, { 0x1556, 13},
+{ 0x02FA, 13}, { 0x0181, 11}, { 0x1557, 13}, { 0x059D, 14}, { 0x2AA3, 14}, { 0x2B2A, 14},
+{ 0x01DE, 14}, { 0x063C, 13}, { 0x00CF, 13}, { 0x1594, 13}, { 0x000D, 9}
+},
+{
+{ 0x0002, 2}, { 0x0006, 3}, { 0x000F, 4}, { 0x000D, 5}, { 0x000C, 5}, { 0x0015, 6},
+{ 0x0013, 6}, { 0x0012, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x001E, 8}, { 0x001D, 8},
+{ 0x0025, 9}, { 0x0024, 9}, { 0x0023, 9}, { 0x0021, 9}, { 0x0021, 10}, { 0x0020, 10},
+{ 0x000F, 10}, { 0x000E, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11}, { 0x0021, 11},
+{ 0x0050, 12}, { 0x0051, 12}, { 0x0052, 12}, { 0x000E, 4}, { 0x0014, 6}, { 0x0016, 7},
+{ 0x001C, 8}, { 0x0020, 9}, { 0x001F, 9}, { 0x000D, 10}, { 0x0022, 11}, { 0x0053, 12},
+{ 0x0055, 12}, { 0x000B, 5}, { 0x0015, 7}, { 0x001E, 9}, { 0x000C, 10}, { 0x0056, 12},
+{ 0x0011, 6}, { 0x001B, 8}, { 0x001D, 9}, { 0x000B, 10}, { 0x0010, 6}, { 0x0022, 9},
+{ 0x000A, 10}, { 0x000D, 6}, { 0x001C, 9}, { 0x0008, 10}, { 0x0012, 7}, { 0x001B, 9},
+{ 0x0054, 12}, { 0x0014, 7}, { 0x001A, 9}, { 0x0057, 12}, { 0x0019, 8}, { 0x0009, 10},
+{ 0x0018, 8}, { 0x0023, 11}, { 0x0017, 8}, { 0x0019, 9}, { 0x0018, 9}, { 0x0007, 10},
+{ 0x0058, 12}, { 0x0007, 4}, { 0x000C, 6}, { 0x0016, 8}, { 0x0017, 9}, { 0x0006, 10},
+{ 0x0005, 11}, { 0x0004, 11}, { 0x0059, 12}, { 0x000F, 6}, { 0x0016, 9}, { 0x0005, 10},
+{ 0x000E, 6}, { 0x0004, 10}, { 0x0011, 7}, { 0x0024, 11}, { 0x0010, 7}, { 0x0025, 11},
+{ 0x0013, 7}, { 0x005A, 12}, { 0x0015, 8}, { 0x005B, 12}, { 0x0014, 8}, { 0x0013, 8},
+{ 0x001A, 8}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9}, { 0x0012, 9}, { 0x0011, 9},
+{ 0x0026, 11}, { 0x0027, 11}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12},
+{ 0x0003, 7}
+},
+{
+{ 0x0002, 2}, { 0x000F, 4}, { 0x0015, 6}, { 0x0017, 7}, { 0x001F, 8}, { 0x0025, 9},
+{ 0x0024, 9}, { 0x0021, 10}, { 0x0020, 10}, { 0x0007, 11}, { 0x0006, 11}, { 0x0020, 11},
+{ 0x0006, 3}, { 0x0014, 6}, { 0x001E, 8}, { 0x000F, 10}, { 0x0021, 11}, { 0x0050, 12},
+{ 0x000E, 4}, { 0x001D, 8}, { 0x000E, 10}, { 0x0051, 12}, { 0x000D, 5}, { 0x0023, 9},
+{ 0x000D, 10}, { 0x000C, 5}, { 0x0022, 9}, { 0x0052, 12}, { 0x000B, 5}, { 0x000C, 10},
+{ 0x0053, 12}, { 0x0013, 6}, { 0x000B, 10}, { 0x0054, 12}, { 0x0012, 6}, { 0x000A, 10},
+{ 0x0011, 6}, { 0x0009, 10}, { 0x0010, 6}, { 0x0008, 10}, { 0x0016, 7}, { 0x0055, 12},
+{ 0x0015, 7}, { 0x0014, 7}, { 0x001C, 8}, { 0x001B, 8}, { 0x0021, 9}, { 0x0020, 9},
+{ 0x001F, 9}, { 0x001E, 9}, { 0x001D, 9}, { 0x001C, 9}, { 0x001B, 9}, { 0x001A, 9},
+{ 0x0022, 11}, { 0x0023, 11}, { 0x0056, 12}, { 0x0057, 12}, { 0x0007, 4}, { 0x0019, 9},
+{ 0x0005, 11}, { 0x000F, 6}, { 0x0004, 11}, { 0x000E, 6}, { 0x000D, 6}, { 0x000C, 6},
+{ 0x0013, 7}, { 0x0012, 7}, { 0x0011, 7}, { 0x0010, 7}, { 0x001A, 8}, { 0x0019, 8},
+{ 0x0018, 8}, { 0x0017, 8}, { 0x0016, 8}, { 0x0015, 8}, { 0x0014, 8}, { 0x0013, 8},
+{ 0x0018, 9}, { 0x0017, 9}, { 0x0016, 9}, { 0x0015, 9}, { 0x0014, 9}, { 0x0013, 9},
+{ 0x0012, 9}, { 0x0011, 9}, { 0x0007, 10}, { 0x0006, 10}, { 0x0005, 10}, { 0x0004, 10},
+{ 0x0024, 11}, { 0x0025, 11}, { 0x0026, 11}, { 0x0027, 11}, { 0x0058, 12}, { 0x0059, 12},
+{ 0x005A, 12}, { 0x005B, 12}, { 0x005C, 12}, { 0x005D, 12}, { 0x005E, 12}, { 0x005F, 12},
+{ 0x0003, 7}
+},
+{
+{ 0x0000, 2}, { 0x0003, 3}, { 0x000D, 4}, { 0x0005, 4}, { 0x001C, 5}, { 0x0016, 5},
+{ 0x003F, 6}, { 0x003A, 6}, { 0x002E, 6}, { 0x0022, 6}, { 0x007B, 7}, { 0x0067, 7},
+{ 0x005F, 7}, { 0x0047, 7}, { 0x0026, 7}, { 0x00EF, 8}, { 0x00CD, 8}, { 0x00C1, 8},
+{ 0x00A9, 8}, { 0x004F, 8}, { 0x01F2, 9}, { 0x01DD, 9}, { 0x0199, 9}, { 0x0185, 9},
+{ 0x015D, 9}, { 0x011B, 9}, { 0x03EF, 10}, { 0x03E1, 10}, { 0x03C8, 10}, { 0x0331, 10},
+{ 0x0303, 10}, { 0x02F1, 10}, { 0x02A0, 10}, { 0x0233, 10}, { 0x0126, 10}, { 0x07C0, 11},
+{ 0x076F, 11}, { 0x076C, 11}, { 0x0661, 11}, { 0x0604, 11}, { 0x0572, 11}, { 0x0551, 11},
+{ 0x046A, 11}, { 0x0274, 11}, { 0x0F27, 12}, { 0x0F24, 12}, { 0x0EDB, 12}, { 0x0C8E, 12},
+{ 0x0C0B, 12}, { 0x0C0A, 12}, { 0x0AE3, 12}, { 0x08D6, 12}, { 0x0490, 12}, { 0x0495, 12},
+{ 0x1F19, 13}, { 0x1DB5, 13}, { 0x0009, 4}, { 0x0010, 5}, { 0x0029, 6}, { 0x0062, 7},
+{ 0x00F3, 8}, { 0x00AD, 8}, { 0x01E5, 9}, { 0x0179, 9}, { 0x009C, 9}, { 0x03B1, 10},
+{ 0x02AE, 10}, { 0x0127, 10}, { 0x076E, 11}, { 0x0570, 11}, { 0x0275, 11}, { 0x0F25, 12},
+{ 0x0EC0, 12}, { 0x0AA0, 12}, { 0x08D7, 12}, { 0x1E4C, 13}, { 0x0008, 5}, { 0x0063, 7},
+{ 0x00AF, 8}, { 0x017B, 9}, { 0x03B3, 10}, { 0x07DD, 11}, { 0x0640, 11}, { 0x0F8D, 12},
+{ 0x0BC1, 12}, { 0x0491, 12}, { 0x0028, 6}, { 0x00C3, 8}, { 0x0151, 9}, { 0x02A1, 10},
+{ 0x0573, 11}, { 0x0EC3, 12}, { 0x1F35, 13}, { 0x0065, 7}, { 0x01DA, 9}, { 0x02AF, 10},
+{ 0x0277, 11}, { 0x08C9, 12}, { 0x1781, 13}, { 0x0025, 7}, { 0x0118, 9}, { 0x0646, 11},
+{ 0x0AA6, 12}, { 0x1780, 13}, { 0x00C9, 8}, { 0x0321, 10}, { 0x0F9B, 12}, { 0x191E, 13},
+{ 0x0048, 8}, { 0x07CC, 11}, { 0x0AA1, 12}, { 0x0180, 9}, { 0x0465, 11}, { 0x1905, 13},
+{ 0x03E2, 10}, { 0x0EC1, 12}, { 0x3C9B, 14}, { 0x02F4, 10}, { 0x08C8, 12}, { 0x07C1, 11},
+{ 0x0928, 13}, { 0x05E1, 11}, { 0x320D, 14}, { 0x0EC2, 12}, { 0x6418, 15}, { 0x1F34, 13},
+{ 0x0078, 7}, { 0x0155, 9}, { 0x0552, 11}, { 0x191F, 13}, { 0x00FA, 8}, { 0x07DC, 11},
+{ 0x1907, 13}, { 0x00AC, 8}, { 0x0249, 11}, { 0x13B1, 14}, { 0x01F6, 9}, { 0x0AE2, 12},
+{ 0x01DC, 9}, { 0x04ED, 12}, { 0x0184, 9}, { 0x1904, 13}, { 0x0156, 9}, { 0x09D9, 13},
+{ 0x03E7, 10}, { 0x0929, 13}, { 0x03B2, 10}, { 0x3B68, 14}, { 0x02F5, 10}, { 0x13B0, 14},
+{ 0x0322, 10}, { 0x3B69, 14}, { 0x0234, 10}, { 0x7935, 15}, { 0x07C7, 11}, { 0xC833, 16},
+{ 0x0660, 11}, { 0x7934, 15}, { 0x024B, 11}, { 0xC832, 16}, { 0x0AA7, 12}, { 0x1F18, 13},
+{ 0x007A, 7}
+},
+{
+{ 0x0002, 2}, { 0x0000, 3}, { 0x001E, 5}, { 0x0004, 5}, { 0x0012, 6}, { 0x0070, 7},
+{ 0x001A, 7}, { 0x005F, 8}, { 0x0047, 8}, { 0x01D3, 9}, { 0x00B5, 9}, { 0x0057, 9},
+{ 0x03B5, 10}, { 0x016D, 10}, { 0x0162, 10}, { 0x07CE, 11}, { 0x0719, 11}, { 0x0691, 11},
+{ 0x02C6, 11}, { 0x0156, 11}, { 0x0F92, 12}, { 0x0D2E, 12}, { 0x0D20, 12}, { 0x059E, 12},
+{ 0x0468, 12}, { 0x02A6, 12}, { 0x1DA2, 13}, { 0x1C60, 13}, { 0x1A43, 13}, { 0x0B1D, 13},
+{ 0x08C0, 13}, { 0x055D, 13}, { 0x0003, 3}, { 0x000A, 5}, { 0x0077, 7}, { 0x00E5, 8},
+{ 0x01D9, 9}, { 0x03E5, 10}, { 0x0166, 10}, { 0x0694, 11}, { 0x0152, 11}, { 0x059F, 12},
+{ 0x1F3C, 13}, { 0x1A4B, 13}, { 0x055E, 13}, { 0x000C, 4}, { 0x007D, 7}, { 0x0044, 8},
+{ 0x03E0, 10}, { 0x0769, 11}, { 0x0E31, 12}, { 0x1F26, 13}, { 0x055C, 13}, { 0x001B, 5},
+{ 0x00E2, 8}, { 0x03A5, 10}, { 0x02C9, 11}, { 0x1F23, 13}, { 0x3B47, 14}, { 0x0007, 5},
+{ 0x01D8, 9}, { 0x02D8, 11}, { 0x1F27, 13}, { 0x3494, 14}, { 0x0035, 6}, { 0x03E1, 10},
+{ 0x059C, 12}, { 0x38C3, 14}, { 0x000C, 6}, { 0x0165, 10}, { 0x1D23, 13}, { 0x1638, 14},
+{ 0x0068, 7}, { 0x0693, 11}, { 0x3A45, 14}, { 0x0020, 7}, { 0x0F90, 12}, { 0x7CF6, 15},
+{ 0x00E8, 8}, { 0x058F, 12}, { 0x2CEF, 15}, { 0x0045, 8}, { 0x0B3A, 13}, { 0x01F1, 9},
+{ 0x3B46, 14}, { 0x01A7, 9}, { 0x1676, 14}, { 0x0056, 9}, { 0x692A, 15}, { 0x038D, 10},
+{ 0xE309, 16}, { 0x00AA, 10}, { 0x1C611, 17}, { 0x02DF, 11}, { 0xB3B9, 17}, { 0x02C8, 11},
+{ 0x38C20, 18}, { 0x01B0, 11}, { 0x16390, 18}, { 0x0F9F, 12}, { 0x16771, 18}, { 0x0ED0, 12},
+{ 0x71843, 19}, { 0x0D2A, 12}, { 0xF9E8C, 20}, { 0x0461, 12}, { 0xF9E8E, 20}, { 0x0B67, 13},
+{ 0x055F, 13}, { 0x003F, 6}, { 0x006D, 9}, { 0x0E90, 12}, { 0x054E, 13}, { 0x0013, 6},
+{ 0x0119, 10}, { 0x0B66, 13}, { 0x000B, 6}, { 0x0235, 11}, { 0x7CF5, 15}, { 0x0075, 7},
+{ 0x0D24, 12}, { 0xF9E9, 16}, { 0x002E, 7}, { 0x1F22, 13}, { 0x0021, 7}, { 0x054F, 13},
+{ 0x0014, 7}, { 0x3A44, 14}, { 0x00E4, 8}, { 0x7CF7, 15}, { 0x005E, 8}, { 0x7185, 15},
+{ 0x0037, 8}, { 0x2C73, 15}, { 0x01DB, 9}, { 0x59DD, 16}, { 0x01C7, 9}, { 0x692B, 15},
+{ 0x01A6, 9}, { 0x58E5, 16}, { 0x00B4, 9}, { 0x1F3D0, 17}, { 0x00B0, 9}, { 0xB1C9, 17},
+{ 0x03E6, 10}, { 0x16770, 18}, { 0x016E, 10}, { 0x3E7A2, 18}, { 0x011B, 10}, { 0xF9E8D, 20},
+{ 0x00D9, 10}, { 0xF9E8F, 20}, { 0x00A8, 10}, { 0x2C723, 19}, { 0x0749, 11}, { 0xE3084, 20},
+{ 0x0696, 11}, { 0x58E45, 20}, { 0x02DE, 11}, { 0xB1C88, 21}, { 0x0231, 11}, { 0x1C610A, 21},
+{ 0x01B1, 11}, { 0x71842D, 23}, { 0x0D2B, 12}, { 0x38C217, 22}, { 0x0D2F, 12}, { 0x163913, 22},
+{ 0x05B2, 12}, { 0x163912, 22}, { 0x0469, 12}, { 0x71842C, 23}, { 0x1A42, 13}, { 0x08C1, 13},
+{ 0x0073, 7}
+}
+};
+
const int ff_vc1_ac_sizes[AC_MODES] = {
186, 169, 133, 149, 103, 103, 163, 175
};
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 2cb39430f5..b74956c6a3 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -43,7 +43,10 @@
#include "simple_idct.h"
#include "vc1.h"
#include "vc1data.h"
+#include "vc1_vlc_data.h"
+#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
+#include "libavutil/thread.h"
#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
@@ -420,6 +423,144 @@ av_cold void ff_vc1_init_transposed_scantables(VC1Context *v)
v->top_blk_sh = 3;
}
+static const uint16_t vlc_offs[] = {
+ 0, 520, 552, 616, 1128, 1160, 1224, 1740, 1772, 1836, 1900, 2436,
+ 2986, 3050, 3610, 4154, 4218, 4746, 5326, 5390, 5902, 6554, 7658, 8342,
+ 9304, 9988, 10630, 11234, 12174, 13006, 13560, 14232, 14786, 15432, 16350, 17522,
+ 20372, 21818, 22330, 22394, 23166, 23678, 23742, 24820, 25332, 25396, 26460, 26980,
+ 27048, 27592, 27600, 27608, 27616, 27624, 28224, 28258, 28290, 28802, 28834, 28866,
+ 29378, 29412, 29444, 29960, 29994, 30026, 30538, 30572, 30604, 31120, 31154, 31186,
+ 31714, 31746, 31778, 32306, 32340, 32372
+};
+
+static av_cold void vc1_init_static(void)
+{
+ static VLCElem vlc_table[32372];
+
+ INIT_VLC_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4,
+ vc1_norm2_bits, 1, 1,
+ vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS);
+ INIT_VLC_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64,
+ vc1_norm6_bits, 1, 1,
+ vc1_norm6_codes, 2, 2, 556);
+ INIT_VLC_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7,
+ vc1_imode_bits, 1, 1,
+ vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS);
+ for (int i = 0; i < 3; i++) {
+ ff_vc1_ttmb_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 0]];
+ ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0];
+ init_vlc(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16,
+ vc1_ttmb_bits[i], 1, 1,
+ vc1_ttmb_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
+ ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]];
+ ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1];
+ init_vlc(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8,
+ vc1_ttblk_bits[i], 1, 1,
+ vc1_ttblk_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]];
+ ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2];
+ init_vlc(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15,
+ vc1_subblkpat_bits[i], 1, 1,
+ vc1_subblkpat_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ }
+ for (int i = 0; i < 4; i++) {
+ ff_vc1_4mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 9]];
+ ff_vc1_4mv_block_pattern_vlc[i].table_allocated = vlc_offs[i * 3 + 10] - vlc_offs[i * 3 + 9];
+ init_vlc(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16,
+ vc1_4mv_block_pattern_bits[i], 1, 1,
+ vc1_4mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ ff_vc1_cbpcy_p_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 10]];
+ ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10];
+ init_vlc(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64,
+ vc1_cbpcy_p_bits[i], 1, 1,
+ vc1_cbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
+ ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]];
+ ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11];
+ init_vlc(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73,
+ vc1_mv_diff_bits[i], 1, 1,
+ vc1_mv_diff_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
+ }
+ for (int i = 0; i < 8; i++) {
+ ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]];
+ ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i * 2 + 22] - vlc_offs[i * 2 + 21];
+ init_vlc(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i],
+ &vc1_ac_tables[i][0][1], 8, 4,
+ &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_STATIC);
+ /* initialize interlaced MVDATA tables (2-Ref) */
+ ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]];
+ ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22];
+ init_vlc(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126,
+ vc1_2ref_mvdata_bits[i], 1, 1,
+ vc1_2ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
+ }
+ for (int i = 0; i < 4; i++) {
+ /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */
+ ff_vc1_intfr_4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 37]];
+ ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37];
+ init_vlc(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15,
+ vc1_intfr_4mv_mbmode_bits[i], 1, 1,
+ vc1_intfr_4mv_mbmode_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
+ /* initialize NON-4MV MBMODE VLC tables for the same */
+ ff_vc1_intfr_non4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 38]];
+ ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38];
+ init_vlc(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9,
+ vc1_intfr_non4mv_mbmode_bits[i], 1, 1,
+ vc1_intfr_non4mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ /* initialize interlaced MVDATA tables (1-Ref) */
+ ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]];
+ ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39];
+ init_vlc(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72,
+ vc1_1ref_mvdata_bits[i], 1, 1,
+ vc1_1ref_mvdata_codes[i], 4, 4, INIT_VLC_USE_NEW_STATIC);
+ }
+ for (int i = 0; i < 4; i++) {
+ /* Initialize 2MV Block pattern VLC tables */
+ ff_vc1_2mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i + 49]];
+ ff_vc1_2mv_block_pattern_vlc[i].table_allocated = vlc_offs[i + 50] - vlc_offs[i + 49];
+ init_vlc(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4,
+ vc1_2mv_block_pattern_bits[i], 1, 1,
+ vc1_2mv_block_pattern_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ }
+ for (int i = 0; i < 8; i++) {
+ /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */
+ ff_vc1_icbpcy_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 53]];
+ ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53];
+ init_vlc(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63,
+ vc1_icbpcy_p_bits[i], 1, 1,
+ vc1_icbpcy_p_codes[i], 2, 2, INIT_VLC_USE_NEW_STATIC);
+ /* Initialize interlaced field picture MBMODE VLC tables */
+ ff_vc1_if_mmv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 54]];
+ ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54];
+ init_vlc(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8,
+ vc1_if_mmv_mbmode_bits[i], 1, 1,
+ vc1_if_mmv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ ff_vc1_if_1mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 55]];
+ ff_vc1_if_1mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 56] - vlc_offs[i * 3 + 55];
+ init_vlc(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6,
+ vc1_if_1mv_mbmode_bits[i], 1, 1,
+ vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
+ }
+}
+
+/**
+ * Init VC-1 specific tables and VC1Context members
+ * @param v The VC1Context to initialize
+ * @return Status
+ */
+av_cold void ff_vc1_init_common(VC1Context *v)
+{
+ static AVOnce init_static_once = AV_ONCE_INIT;
+
+ /* defaults */
+ v->pq = -1;
+ v->mvrange = 0; /* 7.1.1.18, p80 */
+
+ ff_vc1dsp_init(&v->vc1dsp);
+
+ /* VLC tables */
+ ff_thread_once(&init_static_once, vc1_init_static);
+}
+
/** Initialize a VC1/WMV3 decoder
* @todo TODO: Handle VC-1 IDUs (Transport level?)
* @todo TODO: Decipher remaining bits in extra_data
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 12/19] avcodec/vc1_block: Don't duplicate #defines
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (9 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 11/19] avcodec/vc1: Move ff_vc1_init_common() to vc1dec.c Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 13/19] avcodec/msmpeg4dec: Factor initializing VLCs shared with VC-1 out Andreas Rheinhardt
` (12 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
VC1 shares some VLCs with MSMPEG-4, but vc1_block.c
simply duplicates the defines instead of including
the appropriate headers; furthermore, use a proper
prefix for these defines: DC_VLC_BITS is also used
by other codecs.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/msmpeg4data.h | 2 ++
libavcodec/msmpeg4dec.c | 27 ++++++++++++++-------------
libavcodec/msmpeg4dec.h | 1 -
libavcodec/vc1_block.c | 27 ++++++++++++++++-----------
libavcodec/wmv2dec.c | 3 ++-
5 files changed, 34 insertions(+), 26 deletions(-)
diff --git a/libavcodec/msmpeg4data.h b/libavcodec/msmpeg4data.h
index b2b5bade4d..4f904d7610 100644
--- a/libavcodec/msmpeg4data.h
+++ b/libavcodec/msmpeg4data.h
@@ -48,7 +48,9 @@ typedef struct MVTable {
} MVTable;
FF_VISIBILITY_PUSH_HIDDEN
+#define MSMP4_MB_INTRA_VLC_BITS 9
extern VLC ff_msmp4_mb_i_vlc;
+#define MSMP4_DC_VLC_BITS 9
extern VLC ff_msmp4_dc_luma_vlc[2];
extern VLC ff_msmp4_dc_chroma_vlc[2];
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index bc554ed2eb..a7ba53f68e 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -37,7 +37,6 @@
#include "mpeg4videodec.h"
#include "msmpeg4data.h"
-#define DC_VLC_BITS 9
#define V2_INTRA_CBPC_VLC_BITS 3
#define V2_MB_TYPE_VLC_BITS 7
#define MV_VLC_BITS 9
@@ -237,7 +236,7 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64])
cbp = code & 0x3f;
} else {
s->mb_intra = 1;
- code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
+ code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MSMP4_MB_INTRA_VLC_BITS, 2);
/* predict coded block pattern */
cbp = 0;
for(i=0;i<6;i++) {
@@ -317,23 +316,23 @@ static av_cold void msmpeg4_decode_init_static(void)
mv->table_mv_bits, 1, 1,
mv->table_mv_code, 2, 2, 2694);
- INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], DC_VLC_BITS, 120,
+ INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120,
&ff_table0_dc_lum[0][1], 8, 4,
&ff_table0_dc_lum[0][0], 8, 4, 1158);
- INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], DC_VLC_BITS, 120,
+ INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120,
&ff_table0_dc_chroma[0][1], 8, 4,
&ff_table0_dc_chroma[0][0], 8, 4, 1118);
- INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], DC_VLC_BITS, 120,
+ INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120,
&ff_table1_dc_lum[0][1], 8, 4,
&ff_table1_dc_lum[0][0], 8, 4, 1476);
- INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], DC_VLC_BITS, 120,
+ INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120,
&ff_table1_dc_chroma[0][1], 8, 4,
&ff_table1_dc_chroma[0][0], 8, 4, 1216);
- INIT_VLC_STATIC(&v2_dc_lum_vlc, DC_VLC_BITS, 512,
+ INIT_VLC_STATIC(&v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 512,
&ff_v2_dc_lum_table[0][1], 8, 4,
&ff_v2_dc_lum_table[0][0], 8, 4, 1472);
- INIT_VLC_STATIC(&v2_dc_chroma_vlc, DC_VLC_BITS, 512,
+ INIT_VLC_STATIC(&v2_dc_chroma_vlc, MSMP4_DC_VLC_BITS, 512,
&ff_v2_dc_chroma_table[0][1], 8, 4,
&ff_v2_dc_chroma_table[0][0], 8, 4, 1506);
@@ -355,7 +354,7 @@ static av_cold void msmpeg4_decode_init_static(void)
offset += ff_mb_non_intra_vlc[i].table_size;
}
- INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64,
+ INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64,
&ff_msmp4_mb_i_table[0][1], 4, 2,
&ff_msmp4_mb_i_table[0][0], 4, 2, 536);
@@ -591,9 +590,9 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
if(s->msmpeg4_version<=2){
if (n < 4) {
- level = get_vlc2(&s->gb, v2_dc_lum_vlc.table, DC_VLC_BITS, 3);
+ level = get_vlc2(&s->gb, v2_dc_lum_vlc.table, MSMP4_DC_VLC_BITS, 3);
} else {
- level = get_vlc2(&s->gb, v2_dc_chroma_vlc.table, DC_VLC_BITS, 3);
+ level = get_vlc2(&s->gb, v2_dc_chroma_vlc.table, MSMP4_DC_VLC_BITS, 3);
}
if (level < 0) {
av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");
@@ -603,9 +602,11 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
level-=256;
}else{ //FIXME optimize use unified tables & index
if (n < 4) {
- level = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
+ level = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table,
+ MSMP4_DC_VLC_BITS, 3);
} else {
- level = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
+ level = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table,
+ MSMP4_DC_VLC_BITS, 3);
}
if (level == DC_MAX) {
diff --git a/libavcodec/msmpeg4dec.h b/libavcodec/msmpeg4dec.h
index 19b5c12c6c..ad41eea9d4 100644
--- a/libavcodec/msmpeg4dec.h
+++ b/libavcodec/msmpeg4dec.h
@@ -27,7 +27,6 @@
#define INTER_INTRA_VLC_BITS 3
#define MB_NON_INTRA_VLC_BITS 9
-#define MB_INTRA_VLC_BITS 9
extern VLC ff_mb_non_intra_vlc[4];
extern VLC ff_inter_intra_vlc;
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index ef8ce40e68..9293c509cb 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -37,9 +37,6 @@
#include "vc1acdata.h"
#include "vc1data.h"
-#define MB_INTRA_VLC_BITS 9
-#define DC_VLC_BITS 9
-
// offset tables for interlaced picture MVDATA decoding
static const uint8_t offset_table[2][9] = {
{ 0, 1, 2, 4, 8, 16, 32, 64, 128 },
@@ -596,9 +593,11 @@ static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n,
/* Get DC differential */
if (n < 4) {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
+ dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table,
+ MSMP4_DC_VLC_BITS, 3);
} else {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
+ dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table,
+ MSMP4_DC_VLC_BITS, 3);
}
if (dcdiff) {
const int m = (v->pq == 1 || v->pq == 2) ? 3 - v->pq : 0;
@@ -740,9 +739,11 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n,
/* Get DC differential */
if (n < 4) {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
+ dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table,
+ MSMP4_DC_VLC_BITS, 3);
} else {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
+ dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table,
+ MSMP4_DC_VLC_BITS, 3);
}
if (dcdiff) {
const int m = (quant == 1 || quant == 2) ? 3 - quant : 0;
@@ -940,9 +941,11 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n,
/* Get DC differential */
if (n < 4) {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
+ dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table,
+ MSMP4_DC_VLC_BITS, 3);
} else {
- dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3);
+ dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table,
+ MSMP4_DC_VLC_BITS, 3);
}
if (dcdiff) {
const int m = (quant == 1 || quant == 2) ? 3 - quant : 0;
@@ -2588,7 +2591,8 @@ static void vc1_decode_i_blocks(VC1Context *v)
}
// do actual MB decoding and displaying
- cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
+ cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table,
+ MSMP4_MB_INTRA_VLC_BITS, 2);
v->s.ac_pred = get_bits1(&v->s.gb);
for (k = 0; k < 6; k++) {
@@ -2723,7 +2727,8 @@ static int vc1_decode_i_blocks_adv(VC1Context *v)
return 0;
}
- cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
+ cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table,
+ MSMP4_MB_INTRA_VLC_BITS, 2);
if (v->acpred_is_raw)
v->s.ac_pred = get_bits1(&v->s.gb);
else
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 2daf6c70e8..1209b1902d 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -482,7 +482,8 @@ static int wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
s->mb_intra = 1;
if (get_bits_left(&s->gb) <= 0)
return AVERROR_INVALIDDATA;
- code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
+ code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table,
+ MSMP4_MB_INTRA_VLC_BITS, 2);
/* predict coded block pattern */
cbp = 0;
for (i = 0; i < 6; i++) {
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 13/19] avcodec/msmpeg4dec: Factor initializing VLCs shared with VC-1 out
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (10 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 12/19] avcodec/vc1_block: Don't duplicate #defines Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 14/19] avcodec/vc1dec: Don't open and close decoder during init Andreas Rheinhardt
` (11 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It will be useful in the following commits.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/msmpeg4data.c | 30 ++++++++++++++++++++++++++++++
libavcodec/msmpeg4data.h | 2 ++
libavcodec/msmpeg4dec.c | 18 +-----------------
3 files changed, 33 insertions(+), 17 deletions(-)
diff --git a/libavcodec/msmpeg4data.c b/libavcodec/msmpeg4data.c
index 63f30ac544..7b54eea221 100644
--- a/libavcodec/msmpeg4data.c
+++ b/libavcodec/msmpeg4data.c
@@ -30,6 +30,10 @@
#include "h263data.h"
#include "mpeg4videodata.h"
#include "msmpeg4data.h"
+#include "rl.h"
+#include "vlc.h"
+#include "libavutil/attributes.h"
+#include "libavutil/thread.h"
uint32_t ff_v2_dc_lum_table[512][2];
uint32_t ff_v2_dc_chroma_table[512][2];
@@ -38,6 +42,32 @@ VLC ff_msmp4_mb_i_vlc;
VLC ff_msmp4_dc_luma_vlc[2];
VLC ff_msmp4_dc_chroma_vlc[2];
+static av_cold void msmp4_vc1_vlcs_init(void)
+{
+ INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120,
+ &ff_table0_dc_lum[0][1], 8, 4,
+ &ff_table0_dc_lum[0][0], 8, 4, 1158);
+ INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120,
+ &ff_table0_dc_chroma[0][1], 8, 4,
+ &ff_table0_dc_chroma[0][0], 8, 4, 1118);
+ INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120,
+ &ff_table1_dc_lum[0][1], 8, 4,
+ &ff_table1_dc_lum[0][0], 8, 4, 1476);
+ INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120,
+ &ff_table1_dc_chroma[0][1], 8, 4,
+ &ff_table1_dc_chroma[0][0], 8, 4, 1216);
+
+ INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64,
+ &ff_msmp4_mb_i_table[0][1], 4, 2,
+ &ff_msmp4_mb_i_table[0][0], 4, 2, 536);
+}
+
+av_cold void ff_msmp4_vc1_vlcs_init_once(void)
+{
+ static AVOnce init_static_once = AV_ONCE_INIT;
+ ff_thread_once(&init_static_once, msmp4_vc1_vlcs_init);
+}
+
/* intra picture macroblock coded block pattern */
const uint16_t ff_msmp4_mb_i_table[64][2] = {
{ 0x1, 1 }, { 0x17, 6 }, { 0x9, 5 }, { 0x5, 5 },
diff --git a/libavcodec/msmpeg4data.h b/libavcodec/msmpeg4data.h
index 4f904d7610..ccbfde36f7 100644
--- a/libavcodec/msmpeg4data.h
+++ b/libavcodec/msmpeg4data.h
@@ -48,6 +48,8 @@ typedef struct MVTable {
} MVTable;
FF_VISIBILITY_PUSH_HIDDEN
+void ff_msmp4_vc1_vlcs_init_once(void);
+
#define MSMP4_MB_INTRA_VLC_BITS 9
extern VLC ff_msmp4_mb_i_vlc;
#define MSMP4_DC_VLC_BITS 9
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index a7ba53f68e..2be8cf2bf6 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -316,19 +316,6 @@ static av_cold void msmpeg4_decode_init_static(void)
mv->table_mv_bits, 1, 1,
mv->table_mv_code, 2, 2, 2694);
- INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120,
- &ff_table0_dc_lum[0][1], 8, 4,
- &ff_table0_dc_lum[0][0], 8, 4, 1158);
- INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120,
- &ff_table0_dc_chroma[0][1], 8, 4,
- &ff_table0_dc_chroma[0][0], 8, 4, 1118);
- INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120,
- &ff_table1_dc_lum[0][1], 8, 4,
- &ff_table1_dc_lum[0][0], 8, 4, 1476);
- INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120,
- &ff_table1_dc_chroma[0][1], 8, 4,
- &ff_table1_dc_chroma[0][0], 8, 4, 1216);
-
INIT_VLC_STATIC(&v2_dc_lum_vlc, MSMP4_DC_VLC_BITS, 512,
&ff_v2_dc_lum_table[0][1], 8, 4,
&ff_v2_dc_lum_table[0][0], 8, 4, 1472);
@@ -354,13 +341,10 @@ static av_cold void msmpeg4_decode_init_static(void)
offset += ff_mb_non_intra_vlc[i].table_size;
}
- INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64,
- &ff_msmp4_mb_i_table[0][1], 4, 2,
- &ff_msmp4_mb_i_table[0][0], 4, 2, 536);
-
INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4,
&ff_table_inter_intra[0][1], 2, 1,
&ff_table_inter_intra[0][0], 2, 1, 8);
+ ff_msmp4_vc1_vlcs_init_once();
}
av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 14/19] avcodec/vc1dec: Don't open and close decoder during init
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (11 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 13/19] avcodec/msmpeg4dec: Factor initializing VLCs shared with VC-1 out Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 15/19] avcodec/vc1dec: Factor (re)initializing code out Andreas Rheinhardt
` (10 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
This is done since 16af29a7a6deff3f6081fca1e36ad96cf8fec77d
(and is actually unnecessary, because the tables initialized
in ff_msmpeg4_decode_init() are only ever used in vc1_block.c
which is only entered after a call to ff_msmpeg4_decode_init())
in a very ugly manner; said manner had the byproduct of
involving lots of unnecessary allocations and even opening
and closing a hwaccel in case one is used.
This commit achieves the aim of 16af29a7a6deff3f6081fca1e36ad96cf8fec77d
by initializing the VLCs used by VC-1 in ff_vc1_init_common().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1dec.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index b74956c6a3..49ecfd8a48 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -540,6 +540,7 @@ static av_cold void vc1_init_static(void)
vc1_if_1mv_mbmode_bits[i], 1, 1,
vc1_if_1mv_mbmode_codes[i], 1, 1, INIT_VLC_USE_NEW_STATIC);
}
+ ff_msmp4_vc1_vlcs_init_once();
}
/**
@@ -672,16 +673,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
avctx->color_range = AVCOL_RANGE_MPEG;
}
- // ensure static VLC tables are initialized
- if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
- return ret;
- if ((ret = ff_vc1_decode_init_alloc_tables(v)) < 0)
- return ret;
- // Hack to ensure the above functions will be called
- // again once we know all necessary settings.
- // That this is necessary might indicate a bug.
- ff_vc1_decode_end(avctx);
-
ff_blockdsp_init(&s->bdsp);
ff_h264chroma_init(&v->h264chroma, 8);
ff_qpeldsp_init(&s->qdsp);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 15/19] avcodec/vc1dec: Factor (re)initializing code out
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (12 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 14/19] avcodec/vc1dec: Don't open and close decoder during init Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 16/19] avcodec/vc1dec: Return early upon error Andreas Rheinhardt
` (9 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
This is in preparation for removing the msmpeg4 dependency
from VC-1.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mss2.c | 5 ++---
libavcodec/vc1.h | 2 +-
libavcodec/vc1dec.c | 25 ++++++++++++++++++-------
3 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index 69494d8c44..dca2ae4921 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -29,7 +29,6 @@
#include "error_resilience.h"
#include "mpeg_er.h"
#include "mpegvideodec.h"
-#include "msmpeg4dec.h"
#include "qpeldsp.h"
#include "vc1.h"
#include "wmv2data.h"
@@ -852,8 +851,8 @@ static av_cold int wmv9_init(AVCodecContext *avctx)
ff_vc1_init_transposed_scantables(v);
- if ((ret = ff_msmpeg4_decode_init(avctx)) < 0 ||
- (ret = ff_vc1_decode_init_alloc_tables(v)) < 0)
+ ret = ff_vc1_decode_init(avctx);
+ if (ret < 0)
return ret;
/* error concealment */
diff --git a/libavcodec/vc1.h b/libavcodec/vc1.h
index 9b25f0872f..3b6be78141 100644
--- a/libavcodec/vc1.h
+++ b/libavcodec/vc1.h
@@ -413,7 +413,7 @@ int ff_vc1_parse_frame_header (VC1Context *v, GetBitContext *gb);
int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb);
void ff_vc1_init_common(VC1Context *v);
-int ff_vc1_decode_init_alloc_tables(VC1Context *v);
+int ff_vc1_decode_init(AVCodecContext *avctx);
void ff_vc1_init_transposed_scantables(VC1Context *v);
int ff_vc1_decode_end(AVCodecContext *avctx);
void ff_vc1_decode_blocks(VC1Context *v);
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 49ecfd8a48..682b39083b 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -329,7 +329,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx)
#endif
-av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
+static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
{
MpegEncContext *s = &v->s;
int i, ret = AVERROR(ENOMEM);
@@ -404,10 +404,24 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
return 0;
error:
- ff_vc1_decode_end(s->avctx);
return ret;
}
+av_cold int ff_vc1_decode_init(AVCodecContext *avctx)
+{
+ int ret = ff_msmpeg4_decode_init(avctx);
+ VC1Context *const v = avctx->priv_data;
+ if (ret < 0)
+ return ret;
+
+ ret = vc1_decode_init_alloc_tables(v);
+ if (ret < 0) {
+ ff_vc1_decode_end(avctx);
+ return ret;
+ }
+ return 0;
+}
+
av_cold void ff_vc1_init_transposed_scantables(VC1Context *v)
{
int i;
@@ -947,12 +961,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict,
}
if (!s->context_initialized) {
- if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
- goto err;
- if ((ret = ff_vc1_decode_init_alloc_tables(v)) < 0) {
- ff_mpv_common_end(s);
+ ret = ff_vc1_decode_init(avctx);
+ if (ret < 0)
goto err;
- }
s->low_delay = !avctx->has_b_frames || v->res_sprite;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 16/19] avcodec/vc1dec: Return early upon error
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (13 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 15/19] avcodec/vc1dec: Factor (re)initializing code out Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 17/19] avcodec/msmpeg4data: Move data shared between msmpeg4 and VC-1 out Andreas Rheinhardt
` (8 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1dec.c | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 682b39083b..1cf42d831f 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -332,7 +332,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx)
static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
{
MpegEncContext *s = &v->s;
- int i, ret = AVERROR(ENOMEM);
+ int i, ret;
int mb_height = FFALIGN(s->mb_height, 2);
/* Allocate mb bitplanes */
@@ -344,31 +344,31 @@ static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
v->over_flags_plane = av_malloc (s->mb_stride * mb_height);
if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->forward_mb_plane ||
!v->fieldtx_plane || !v->acpred_plane || !v->over_flags_plane)
- goto error;
+ return AVERROR(ENOMEM);
v->n_allocated_blks = s->mb_width + 2;
v->block = av_malloc(sizeof(*v->block) * v->n_allocated_blks);
v->cbp_base = av_malloc(sizeof(v->cbp_base[0]) * 3 * s->mb_stride);
if (!v->block || !v->cbp_base)
- goto error;
+ return AVERROR(ENOMEM);
v->cbp = v->cbp_base + 2 * s->mb_stride;
v->ttblk_base = av_malloc(sizeof(v->ttblk_base[0]) * 3 * s->mb_stride);
if (!v->ttblk_base)
- goto error;
+ return AVERROR(ENOMEM);
v->ttblk = v->ttblk_base + 2 * s->mb_stride;
v->is_intra_base = av_mallocz(sizeof(v->is_intra_base[0]) * 3 * s->mb_stride);
if (!v->is_intra_base)
- goto error;
+ return AVERROR(ENOMEM);
v->is_intra = v->is_intra_base + 2 * s->mb_stride;
v->luma_mv_base = av_mallocz(sizeof(v->luma_mv_base[0]) * 3 * s->mb_stride);
if (!v->luma_mv_base)
- goto error;
+ return AVERROR(ENOMEM);
v->luma_mv = v->luma_mv_base + 2 * s->mb_stride;
/* allocate block type info in that way so it could be used with s->block_index[] */
v->mb_type_base = av_malloc(s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
if (!v->mb_type_base)
- goto error;
+ return AVERROR(ENOMEM);
v->mb_type[0] = v->mb_type_base + s->b8_stride + 1;
v->mb_type[1] = v->mb_type_base + s->b8_stride * (mb_height * 2 + 1) + s->mb_stride + 1;
v->mb_type[2] = v->mb_type[1] + s->mb_stride * (mb_height + 1);
@@ -376,35 +376,32 @@ static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
/* allocate memory to store block level MV info */
v->blk_mv_type_base = av_mallocz( s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
if (!v->blk_mv_type_base)
- goto error;
+ return AVERROR(ENOMEM);
v->blk_mv_type = v->blk_mv_type_base + s->b8_stride + 1;
v->mv_f_base = av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2));
if (!v->mv_f_base)
- goto error;
+ return AVERROR(ENOMEM);
v->mv_f[0] = v->mv_f_base + s->b8_stride + 1;
v->mv_f[1] = v->mv_f[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
v->mv_f_next_base = av_mallocz(2 * (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2));
if (!v->mv_f_next_base)
- goto error;
+ return AVERROR(ENOMEM);
v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1;
v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
for (i = 0; i < 4; i++)
if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width)))
- goto error;
+ return AVERROR(ENOMEM);
}
ret = ff_intrax8_common_init(s->avctx, &v->x8,
s->block, s->block_last_index,
s->mb_width, s->mb_height);
if (ret < 0)
- goto error;
+ return ret;
return 0;
-
-error:
- return ret;
}
av_cold int ff_vc1_decode_init(AVCodecContext *avctx)
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 17/19] avcodec/msmpeg4data: Move data shared between msmpeg4 and VC-1 out
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (14 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 16/19] avcodec/vc1dec: Return early upon error Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 18/19] avcodec/vc1dec: Split VC-1 decoders from msmpeg4 Andreas Rheinhardt
` (7 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
This is in preparation for splitting VC-1 from msmpeg4.
(msmpeg4data.c was originally intended to be just this;
9488b966c76a7a52e9a1f7756bda82dbe1070399 changed it).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/Makefile | 8 +-
libavcodec/intrax8.c | 2 +-
libavcodec/msmpeg4.c | 1 +
libavcodec/msmpeg4_vc1_data.c | 254 ++++++++++++++++++++++++++++++++++
libavcodec/msmpeg4_vc1_data.h | 55 ++++++++
libavcodec/msmpeg4data.c | 223 -----------------------------
libavcodec/msmpeg4data.h | 20 ---
libavcodec/msmpeg4dec.c | 1 +
libavcodec/msmpeg4enc.c | 1 +
libavcodec/vc1_block.c | 2 +-
libavcodec/vc1dec.c | 2 +-
libavcodec/wmv2.c | 2 +-
libavcodec/wmv2dec.c | 2 +-
libavcodec/wmv2enc.c | 1 +
14 files changed, 323 insertions(+), 251 deletions(-)
create mode 100644 libavcodec/msmpeg4_vc1_data.c
create mode 100644 libavcodec/msmpeg4_vc1_data.h
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 739bf757f9..ac53bbe219 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -140,8 +140,10 @@ OBJS-$(CONFIG_MPEGVIDEODEC) += mpegvideo_dec.o mpegutils.o
OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
motion_est.o ratecontrol.o \
mpegvideoencdsp.o
-OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
-OBJS-$(CONFIG_MSMPEG4ENC) += msmpeg4enc.o msmpeg4.o msmpeg4data.o
+OBJS-$(CONFIG_MSMPEG4DEC) += msmpeg4dec.o msmpeg4.o msmpeg4data.o \
+ msmpeg4_vc1_data.o
+OBJS-$(CONFIG_MSMPEG4ENC) += msmpeg4enc.o msmpeg4.o msmpeg4data.o \
+ msmpeg4_vc1_data.o
OBJS-$(CONFIG_MSS34DSP) += mss34dsp.o jpegquanttables.o
OBJS-$(CONFIG_PIXBLOCKDSP) += pixblockdsp.o
OBJS-$(CONFIG_QPELDSP) += qpeldsp.o
@@ -724,7 +726,7 @@ OBJS-$(CONFIG_VBN_ENCODER) += vbnenc.o
OBJS-$(CONFIG_VBLE_DECODER) += vble.o
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1_block.o vc1_loopfilter.o \
vc1_mc.o vc1_pred.o vc1.o vc1data.o \
- wmv2data.o
+ msmpeg4_vc1_data.o wmv2data.o
OBJS-$(CONFIG_VC1_CUVID_DECODER) += cuviddec.o
OBJS-$(CONFIG_VC1_MMAL_DECODER) += mmaldec.o
OBJS-$(CONFIG_VC1_QSV_DECODER) += qsvdec.o
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index d6668338fb..e4c8b96c9c 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -26,7 +26,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "idctdsp.h"
-#include "msmpeg4data.h"
+#include "msmpeg4_vc1_data.h"
#include "intrax8huf.h"
#include "intrax8.h"
#include "intrax8dsp.h"
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 3f5dc23130..4daf1666cc 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -38,6 +38,7 @@
#include "libavutil/x86/asm.h"
#include "mpeg4videodata.h"
#include "msmpeg4data.h"
+#include "msmpeg4_vc1_data.h"
#include "mpegvideodata.h"
#include "vc1data.h"
#include "libavutil/imgutils.h"
diff --git a/libavcodec/msmpeg4_vc1_data.c b/libavcodec/msmpeg4_vc1_data.c
new file mode 100644
index 0000000000..059c6f32dc
--- /dev/null
+++ b/libavcodec/msmpeg4_vc1_data.c
@@ -0,0 +1,254 @@
+/*
+ * Common MSMPEG-4 and VC-1 tables and VLC init code
+ * Copyright (c) 2001 Fabrice Bellard
+ * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * msmpeg4v1 & v2 stuff by Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Common MSMPEG-4 and VC-1 tables and VLC init code
+ */
+
+#include "msmpeg4_vc1_data.h"
+#include "vlc.h"
+#include "libavutil/attributes.h"
+#include "libavutil/thread.h"
+
+VLC ff_msmp4_mb_i_vlc;
+VLC ff_msmp4_dc_luma_vlc[2];
+VLC ff_msmp4_dc_chroma_vlc[2];
+
+static av_cold void msmp4_vc1_vlcs_init(void)
+{
+ INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120,
+ &ff_table0_dc_lum[0][1], 8, 4,
+ &ff_table0_dc_lum[0][0], 8, 4, 1158);
+ INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120,
+ &ff_table0_dc_chroma[0][1], 8, 4,
+ &ff_table0_dc_chroma[0][0], 8, 4, 1118);
+ INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120,
+ &ff_table1_dc_lum[0][1], 8, 4,
+ &ff_table1_dc_lum[0][0], 8, 4, 1476);
+ INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120,
+ &ff_table1_dc_chroma[0][1], 8, 4,
+ &ff_table1_dc_chroma[0][0], 8, 4, 1216);
+
+ INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64,
+ &ff_msmp4_mb_i_table[0][1], 4, 2,
+ &ff_msmp4_mb_i_table[0][0], 4, 2, 536);
+}
+
+av_cold void ff_msmp4_vc1_vlcs_init_once(void)
+{
+ static AVOnce init_static_once = AV_ONCE_INIT;
+ ff_thread_once(&init_static_once, msmp4_vc1_vlcs_init);
+}
+
+/* intra picture macroblock coded block pattern */
+const uint16_t ff_msmp4_mb_i_table[64][2] = {
+ { 0x1, 1 }, { 0x17, 6 }, { 0x9, 5 }, { 0x5, 5 },
+ { 0x6, 5 }, { 0x47, 9 }, { 0x20, 7 }, { 0x10, 7 },
+ { 0x2, 5 }, { 0x7c, 9 }, { 0x3a, 7 }, { 0x1d, 7 },
+ { 0x2, 6 }, { 0xec, 9 }, { 0x77, 8 }, { 0x0, 8 },
+ { 0x3, 5 }, { 0xb7, 9 }, { 0x2c, 7 }, { 0x13, 7 },
+ { 0x1, 6 }, { 0x168, 10 }, { 0x46, 8 }, { 0x3f, 8 },
+ { 0x1e, 6 }, { 0x712, 13 }, { 0xb5, 9 }, { 0x42, 8 },
+ { 0x22, 7 }, { 0x1c5, 11 }, { 0x11e, 10 }, { 0x87, 9 },
+ { 0x6, 4 }, { 0x3, 9 }, { 0x1e, 7 }, { 0x1c, 6 },
+ { 0x12, 7 }, { 0x388, 12 }, { 0x44, 9 }, { 0x70, 9 },
+ { 0x1f, 6 }, { 0x23e, 11 }, { 0x39, 8 }, { 0x8e, 9 },
+ { 0x1, 7 }, { 0x1c6, 11 }, { 0xb6, 9 }, { 0x45, 9 },
+ { 0x14, 6 }, { 0x23f, 11 }, { 0x7d, 9 }, { 0x18, 9 },
+ { 0x7, 7 }, { 0x1c7, 11 }, { 0x86, 9 }, { 0x19, 9 },
+ { 0x15, 6 }, { 0x1db, 10 }, { 0x2, 9 }, { 0x46, 9 },
+ { 0xd, 8 }, { 0x713, 13 }, { 0x1da, 10 }, { 0x169, 10 },
+};
+
+/* dc table 0 */
+
+const uint32_t ff_table0_dc_lum[120][2] = {
+ { 0x1, 1 }, { 0x1, 2 }, { 0x1, 4 }, { 0x1, 5 },
+ { 0x5, 5 }, { 0x7, 5 }, { 0x8, 6 }, { 0xc, 6 },
+ { 0x0, 7 }, { 0x2, 7 }, { 0x12, 7 }, { 0x1a, 7 },
+ { 0x3, 8 }, { 0x7, 8 }, { 0x27, 8 }, { 0x37, 8 },
+ { 0x5, 9 }, { 0x4c, 9 }, { 0x6c, 9 }, { 0x6d, 9 },
+ { 0x8, 10 }, { 0x19, 10 }, { 0x9b, 10 }, { 0x1b, 10 },
+ { 0x9a, 10 }, { 0x13, 11 }, { 0x34, 11 }, { 0x35, 11 },
+ { 0x61, 12 }, { 0x48, 13 }, { 0xc4, 13 }, { 0x4a, 13 },
+ { 0xc6, 13 }, { 0xc7, 13 }, { 0x92, 14 }, { 0x18b, 14 },
+ { 0x93, 14 }, { 0x183, 14 }, { 0x182, 14 }, { 0x96, 14 },
+ { 0x97, 14 }, { 0x180, 14 }, { 0x314, 15 }, { 0x315, 15 },
+ { 0x605, 16 }, { 0x604, 16 }, { 0x606, 16 }, { 0xc0e, 17 },
+ { 0x303cd, 23 }, { 0x303c9, 23 }, { 0x303c8, 23 }, { 0x303ca, 23 },
+ { 0x303cb, 23 }, { 0x303cc, 23 }, { 0x303ce, 23 }, { 0x303cf, 23 },
+ { 0x303d0, 23 }, { 0x303d1, 23 }, { 0x303d2, 23 }, { 0x303d3, 23 },
+ { 0x303d4, 23 }, { 0x303d5, 23 }, { 0x303d6, 23 }, { 0x303d7, 23 },
+ { 0x303d8, 23 }, { 0x303d9, 23 }, { 0x303da, 23 }, { 0x303db, 23 },
+ { 0x303dc, 23 }, { 0x303dd, 23 }, { 0x303de, 23 }, { 0x303df, 23 },
+ { 0x303e0, 23 }, { 0x303e1, 23 }, { 0x303e2, 23 }, { 0x303e3, 23 },
+ { 0x303e4, 23 }, { 0x303e5, 23 }, { 0x303e6, 23 }, { 0x303e7, 23 },
+ { 0x303e8, 23 }, { 0x303e9, 23 }, { 0x303ea, 23 }, { 0x303eb, 23 },
+ { 0x303ec, 23 }, { 0x303ed, 23 }, { 0x303ee, 23 }, { 0x303ef, 23 },
+ { 0x303f0, 23 }, { 0x303f1, 23 }, { 0x303f2, 23 }, { 0x303f3, 23 },
+ { 0x303f4, 23 }, { 0x303f5, 23 }, { 0x303f6, 23 }, { 0x303f7, 23 },
+ { 0x303f8, 23 }, { 0x303f9, 23 }, { 0x303fa, 23 }, { 0x303fb, 23 },
+ { 0x303fc, 23 }, { 0x303fd, 23 }, { 0x303fe, 23 }, { 0x303ff, 23 },
+ { 0x60780, 24 }, { 0x60781, 24 }, { 0x60782, 24 }, { 0x60783, 24 },
+ { 0x60784, 24 }, { 0x60785, 24 }, { 0x60786, 24 }, { 0x60787, 24 },
+ { 0x60788, 24 }, { 0x60789, 24 }, { 0x6078a, 24 }, { 0x6078b, 24 },
+ { 0x6078c, 24 }, { 0x6078d, 24 }, { 0x6078e, 24 }, { 0x6078f, 24 },
+};
+
+const uint32_t ff_table0_dc_chroma[120][2] = {
+ { 0x0, 2 }, { 0x1, 2 }, { 0x5, 3 }, { 0x9, 4 },
+ { 0xd, 4 }, { 0x11, 5 }, { 0x1d, 5 }, { 0x1f, 5 },
+ { 0x21, 6 }, { 0x31, 6 }, { 0x38, 6 }, { 0x33, 6 },
+ { 0x39, 6 }, { 0x3d, 6 }, { 0x61, 7 }, { 0x79, 7 },
+ { 0x80, 8 }, { 0xc8, 8 }, { 0xca, 8 }, { 0xf0, 8 },
+ { 0x81, 8 }, { 0xc0, 8 }, { 0xc9, 8 }, { 0x107, 9 },
+ { 0x106, 9 }, { 0x196, 9 }, { 0x183, 9 }, { 0x1e3, 9 },
+ { 0x1e2, 9 }, { 0x20a, 10 }, { 0x20b, 10 }, { 0x609, 11 },
+ { 0x412, 11 }, { 0x413, 11 }, { 0x60b, 11 }, { 0x411, 11 },
+ { 0x60a, 11 }, { 0x65f, 11 }, { 0x410, 11 }, { 0x65d, 11 },
+ { 0x65e, 11 }, { 0xcb8, 12 }, { 0xc10, 12 }, { 0xcb9, 12 },
+ { 0x1823, 13 }, { 0x3045, 14 }, { 0x6089, 15 }, { 0xc110, 16 },
+ { 0x304448, 22 }, { 0x304449, 22 }, { 0x30444a, 22 }, { 0x30444b, 22 },
+ { 0x30444c, 22 }, { 0x30444d, 22 }, { 0x30444e, 22 }, { 0x30444f, 22 },
+ { 0x304450, 22 }, { 0x304451, 22 }, { 0x304452, 22 }, { 0x304453, 22 },
+ { 0x304454, 22 }, { 0x304455, 22 }, { 0x304456, 22 }, { 0x304457, 22 },
+ { 0x304458, 22 }, { 0x304459, 22 }, { 0x30445a, 22 }, { 0x30445b, 22 },
+ { 0x30445c, 22 }, { 0x30445d, 22 }, { 0x30445e, 22 }, { 0x30445f, 22 },
+ { 0x304460, 22 }, { 0x304461, 22 }, { 0x304462, 22 }, { 0x304463, 22 },
+ { 0x304464, 22 }, { 0x304465, 22 }, { 0x304466, 22 }, { 0x304467, 22 },
+ { 0x304468, 22 }, { 0x304469, 22 }, { 0x30446a, 22 }, { 0x30446b, 22 },
+ { 0x30446c, 22 }, { 0x30446d, 22 }, { 0x30446e, 22 }, { 0x30446f, 22 },
+ { 0x304470, 22 }, { 0x304471, 22 }, { 0x304472, 22 }, { 0x304473, 22 },
+ { 0x304474, 22 }, { 0x304475, 22 }, { 0x304476, 22 }, { 0x304477, 22 },
+ { 0x304478, 22 }, { 0x304479, 22 }, { 0x30447a, 22 }, { 0x30447b, 22 },
+ { 0x30447c, 22 }, { 0x30447d, 22 }, { 0x30447e, 22 }, { 0x30447f, 22 },
+ { 0x608880, 23 }, { 0x608881, 23 }, { 0x608882, 23 }, { 0x608883, 23 },
+ { 0x608884, 23 }, { 0x608885, 23 }, { 0x608886, 23 }, { 0x608887, 23 },
+ { 0x608888, 23 }, { 0x608889, 23 }, { 0x60888a, 23 }, { 0x60888b, 23 },
+ { 0x60888c, 23 }, { 0x60888d, 23 }, { 0x60888e, 23 }, { 0x60888f, 23 },
+};
+
+/* dc table 1 */
+
+const uint32_t ff_table1_dc_lum[120][2] = {
+ { 0x2, 2 }, { 0x3, 2 }, { 0x3, 3 }, { 0x2, 4 },
+ { 0x5, 4 }, { 0x1, 5 }, { 0x3, 5 }, { 0x8, 5 },
+ { 0x0, 6 }, { 0x5, 6 }, { 0xd, 6 }, { 0xf, 6 },
+ { 0x13, 6 }, { 0x8, 7 }, { 0x18, 7 }, { 0x1c, 7 },
+ { 0x24, 7 }, { 0x4, 8 }, { 0x6, 8 }, { 0x12, 8 },
+ { 0x32, 8 }, { 0x3b, 8 }, { 0x4a, 8 }, { 0x4b, 8 },
+ { 0xb, 9 }, { 0x26, 9 }, { 0x27, 9 }, { 0x66, 9 },
+ { 0x74, 9 }, { 0x75, 9 }, { 0x14, 10 }, { 0x1c, 10 },
+ { 0x1f, 10 }, { 0x1d, 10 }, { 0x2b, 11 }, { 0x3d, 11 },
+ { 0x19d, 11 }, { 0x19f, 11 }, { 0x54, 12 }, { 0x339, 12 },
+ { 0x338, 12 }, { 0x33d, 12 }, { 0xab, 13 }, { 0xf1, 13 },
+ { 0x678, 13 }, { 0xf2, 13 }, { 0x1e0, 14 }, { 0x1e1, 14 },
+ { 0x154, 14 }, { 0xcf2, 14 }, { 0x3cc, 15 }, { 0x2ab, 15 },
+ { 0x19e7, 15 }, { 0x3ce, 15 }, { 0x19e6, 15 }, { 0x554, 16 },
+ { 0x79f, 16 }, { 0x555, 16 }, { 0xf3d, 17 }, { 0xf37, 17 },
+ { 0xf3c, 17 }, { 0xf35, 17 }, { 0x1e6d, 18 }, { 0x1e68, 18 },
+ { 0x3cd8, 19 }, { 0x3cd3, 19 }, { 0x3cd9, 19 }, { 0x79a4, 20 },
+ { 0xf34ba, 25 }, { 0xf34b4, 25 }, { 0xf34b5, 25 }, { 0xf34b6, 25 },
+ { 0xf34b7, 25 }, { 0xf34b8, 25 }, { 0xf34b9, 25 }, { 0xf34bb, 25 },
+ { 0xf34bc, 25 }, { 0xf34bd, 25 }, { 0xf34be, 25 }, { 0xf34bf, 25 },
+ { 0x1e6940, 26 }, { 0x1e6941, 26 }, { 0x1e6942, 26 }, { 0x1e6943, 26 },
+ { 0x1e6944, 26 }, { 0x1e6945, 26 }, { 0x1e6946, 26 }, { 0x1e6947, 26 },
+ { 0x1e6948, 26 }, { 0x1e6949, 26 }, { 0x1e694a, 26 }, { 0x1e694b, 26 },
+ { 0x1e694c, 26 }, { 0x1e694d, 26 }, { 0x1e694e, 26 }, { 0x1e694f, 26 },
+ { 0x1e6950, 26 }, { 0x1e6951, 26 }, { 0x1e6952, 26 }, { 0x1e6953, 26 },
+ { 0x1e6954, 26 }, { 0x1e6955, 26 }, { 0x1e6956, 26 }, { 0x1e6957, 26 },
+ { 0x1e6958, 26 }, { 0x1e6959, 26 }, { 0x1e695a, 26 }, { 0x1e695b, 26 },
+ { 0x1e695c, 26 }, { 0x1e695d, 26 }, { 0x1e695e, 26 }, { 0x1e695f, 26 },
+ { 0x1e6960, 26 }, { 0x1e6961, 26 }, { 0x1e6962, 26 }, { 0x1e6963, 26 },
+ { 0x1e6964, 26 }, { 0x1e6965, 26 }, { 0x1e6966, 26 }, { 0x1e6967, 26 },
+};
+
+const uint32_t ff_table1_dc_chroma[120][2] = {
+ { 0x0, 2 }, { 0x1, 2 }, { 0x4, 3 }, { 0x7, 3 },
+ { 0xb, 4 }, { 0xd, 4 }, { 0x15, 5 }, { 0x28, 6 },
+ { 0x30, 6 }, { 0x32, 6 }, { 0x52, 7 }, { 0x62, 7 },
+ { 0x66, 7 }, { 0xa6, 8 }, { 0xc6, 8 }, { 0xcf, 8 },
+ { 0x14f, 9 }, { 0x18e, 9 }, { 0x19c, 9 }, { 0x29d, 10 },
+ { 0x33a, 10 }, { 0x538, 11 }, { 0x63c, 11 }, { 0x63e, 11 },
+ { 0x63f, 11 }, { 0x676, 11 }, { 0xa73, 12 }, { 0xc7a, 12 },
+ { 0xcef, 12 }, { 0x14e5, 13 }, { 0x19dd, 13 }, { 0x29c8, 14 },
+ { 0x29c9, 14 }, { 0x63dd, 15 }, { 0x33b8, 14 }, { 0x33b9, 14 },
+ { 0xc7b6, 16 }, { 0x63d8, 15 }, { 0x63df, 15 }, { 0xc7b3, 16 },
+ { 0xc7b4, 16 }, { 0xc7b5, 16 }, { 0x63de, 15 }, { 0xc7b7, 16 },
+ { 0xc7b8, 16 }, { 0xc7b9, 16 }, { 0x18f65, 17 }, { 0x31ec8, 18 },
+ { 0xc7b248, 24 }, { 0xc7b249, 24 }, { 0xc7b24a, 24 }, { 0xc7b24b, 24 },
+ { 0xc7b24c, 24 }, { 0xc7b24d, 24 }, { 0xc7b24e, 24 }, { 0xc7b24f, 24 },
+ { 0xc7b250, 24 }, { 0xc7b251, 24 }, { 0xc7b252, 24 }, { 0xc7b253, 24 },
+ { 0xc7b254, 24 }, { 0xc7b255, 24 }, { 0xc7b256, 24 }, { 0xc7b257, 24 },
+ { 0xc7b258, 24 }, { 0xc7b259, 24 }, { 0xc7b25a, 24 }, { 0xc7b25b, 24 },
+ { 0xc7b25c, 24 }, { 0xc7b25d, 24 }, { 0xc7b25e, 24 }, { 0xc7b25f, 24 },
+ { 0xc7b260, 24 }, { 0xc7b261, 24 }, { 0xc7b262, 24 }, { 0xc7b263, 24 },
+ { 0xc7b264, 24 }, { 0xc7b265, 24 }, { 0xc7b266, 24 }, { 0xc7b267, 24 },
+ { 0xc7b268, 24 }, { 0xc7b269, 24 }, { 0xc7b26a, 24 }, { 0xc7b26b, 24 },
+ { 0xc7b26c, 24 }, { 0xc7b26d, 24 }, { 0xc7b26e, 24 }, { 0xc7b26f, 24 },
+ { 0xc7b270, 24 }, { 0xc7b271, 24 }, { 0xc7b272, 24 }, { 0xc7b273, 24 },
+ { 0xc7b274, 24 }, { 0xc7b275, 24 }, { 0xc7b276, 24 }, { 0xc7b277, 24 },
+ { 0xc7b278, 24 }, { 0xc7b279, 24 }, { 0xc7b27a, 24 }, { 0xc7b27b, 24 },
+ { 0xc7b27c, 24 }, { 0xc7b27d, 24 }, { 0xc7b27e, 24 }, { 0xc7b27f, 24 },
+ { 0x18f6480, 25 }, { 0x18f6481, 25 }, { 0x18f6482, 25 }, { 0x18f6483, 25 },
+ { 0x18f6484, 25 }, { 0x18f6485, 25 }, { 0x18f6486, 25 }, { 0x18f6487, 25 },
+ { 0x18f6488, 25 }, { 0x18f6489, 25 }, { 0x18f648a, 25 }, { 0x18f648b, 25 },
+ { 0x18f648c, 25 }, { 0x18f648d, 25 }, { 0x18f648e, 25 }, { 0x18f648f, 25 },
+};
+
+const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64] = {
+ { 0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
+ 0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
+ 0x30, 0x38, 0x29, 0x21, 0x1A, 0x13, 0x0C, 0x05,
+ 0x06, 0x0D, 0x14, 0x1B, 0x22, 0x31, 0x39, 0x3A,
+ 0x32, 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F,
+ 0x16, 0x1D, 0x24, 0x2B, 0x33, 0x3B, 0x3C, 0x34,
+ 0x2C, 0x25, 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x35,
+ 0x3D, 0x3E, 0x36, 0x2E, 0x27, 0x2F, 0x37, 0x3F, },
+ { 0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
+ 0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
+ 0x21, 0x30, 0x1A, 0x13, 0x0C, 0x05, 0x06, 0x0D,
+ 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, 0x2A,
+ 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, 0x16, 0x1D,
+ 0x24, 0x2B, 0x32, 0x3A, 0x33, 0x3B, 0x2C, 0x25,
+ 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3C, 0x35,
+ 0x3D, 0x2E, 0x27, 0x2F, 0x36, 0x3E, 0x37, 0x3F, },
+ { 0x00, 0x01, 0x08, 0x02, 0x03, 0x09, 0x10, 0x18,
+ 0x11, 0x0A, 0x04, 0x05, 0x0B, 0x12, 0x19, 0x20,
+ 0x28, 0x30, 0x21, 0x1A, 0x13, 0x0C, 0x06, 0x07,
+ 0x0D, 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39,
+ 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x0F, 0x16, 0x1D,
+ 0x24, 0x2B, 0x32, 0x3A, 0x33, 0x2C, 0x25, 0x1E,
+ 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3B, 0x3C, 0x35,
+ 0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F, },
+ { 0x00, 0x08, 0x10, 0x01, 0x18, 0x20, 0x28, 0x09,
+ 0x02, 0x03, 0x0A, 0x11, 0x19, 0x30, 0x38, 0x29,
+ 0x21, 0x1A, 0x12, 0x0B, 0x04, 0x05, 0x0C, 0x13,
+ 0x1B, 0x22, 0x31, 0x39, 0x32, 0x2A, 0x23, 0x1C,
+ 0x14, 0x0D, 0x06, 0x07, 0x0E, 0x15, 0x1D, 0x24,
+ 0x2B, 0x33, 0x3A, 0x3B, 0x34, 0x2C, 0x25, 0x1E,
+ 0x16, 0x0F, 0x17, 0x1F, 0x26, 0x2D, 0x3C, 0x35,
+ 0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F, }
+};
diff --git a/libavcodec/msmpeg4_vc1_data.h b/libavcodec/msmpeg4_vc1_data.h
new file mode 100644
index 0000000000..d12fcb032f
--- /dev/null
+++ b/libavcodec/msmpeg4_vc1_data.h
@@ -0,0 +1,55 @@
+/*
+ * Common MSMPEG-4 and VC-1 tables
+ * Copyright (c) 2001 Fabrice Bellard
+ * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * msmpeg4v1 & v2 stuff by Michael Niedermayer <michaelni@gmx.at>
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_MSMPEG4_VC1_DATA_H
+#define AVCODEC_MSMPEG4_VC1_DATA_H
+
+#include <stdint.h>
+
+#include "vlc.h"
+#include "libavutil/attributes_internal.h"
+
+FF_VISIBILITY_PUSH_HIDDEN
+void ff_msmp4_vc1_vlcs_init_once(void);
+
+#define MSMP4_MB_INTRA_VLC_BITS 9
+extern VLC ff_msmp4_mb_i_vlc;
+#define MSMP4_DC_VLC_BITS 9
+extern VLC ff_msmp4_dc_luma_vlc[2];
+extern VLC ff_msmp4_dc_chroma_vlc[2];
+
+/* intra picture macroblock coded block pattern */
+extern const uint16_t ff_msmp4_mb_i_table[64][2];
+
+#define WMV1_SCANTABLE_COUNT 4
+
+extern const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64];
+
+extern const uint32_t ff_table0_dc_lum[120][2];
+extern const uint32_t ff_table1_dc_lum[120][2];
+extern const uint32_t ff_table0_dc_chroma[120][2];
+extern const uint32_t ff_table1_dc_chroma[120][2];
+FF_VISIBILITY_POP_HIDDEN
+
+#endif /* AVCODEC_MSMPEG4_VC1_DATA_H */
diff --git a/libavcodec/msmpeg4data.c b/libavcodec/msmpeg4data.c
index 7b54eea221..65546da66e 100644
--- a/libavcodec/msmpeg4data.c
+++ b/libavcodec/msmpeg4data.c
@@ -31,63 +31,10 @@
#include "mpeg4videodata.h"
#include "msmpeg4data.h"
#include "rl.h"
-#include "vlc.h"
-#include "libavutil/attributes.h"
-#include "libavutil/thread.h"
uint32_t ff_v2_dc_lum_table[512][2];
uint32_t ff_v2_dc_chroma_table[512][2];
-VLC ff_msmp4_mb_i_vlc;
-VLC ff_msmp4_dc_luma_vlc[2];
-VLC ff_msmp4_dc_chroma_vlc[2];
-
-static av_cold void msmp4_vc1_vlcs_init(void)
-{
- INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[0], MSMP4_DC_VLC_BITS, 120,
- &ff_table0_dc_lum[0][1], 8, 4,
- &ff_table0_dc_lum[0][0], 8, 4, 1158);
- INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[0], MSMP4_DC_VLC_BITS, 120,
- &ff_table0_dc_chroma[0][1], 8, 4,
- &ff_table0_dc_chroma[0][0], 8, 4, 1118);
- INIT_VLC_STATIC(&ff_msmp4_dc_luma_vlc[1], MSMP4_DC_VLC_BITS, 120,
- &ff_table1_dc_lum[0][1], 8, 4,
- &ff_table1_dc_lum[0][0], 8, 4, 1476);
- INIT_VLC_STATIC(&ff_msmp4_dc_chroma_vlc[1], MSMP4_DC_VLC_BITS, 120,
- &ff_table1_dc_chroma[0][1], 8, 4,
- &ff_table1_dc_chroma[0][0], 8, 4, 1216);
-
- INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MSMP4_MB_INTRA_VLC_BITS, 64,
- &ff_msmp4_mb_i_table[0][1], 4, 2,
- &ff_msmp4_mb_i_table[0][0], 4, 2, 536);
-}
-
-av_cold void ff_msmp4_vc1_vlcs_init_once(void)
-{
- static AVOnce init_static_once = AV_ONCE_INIT;
- ff_thread_once(&init_static_once, msmp4_vc1_vlcs_init);
-}
-
-/* intra picture macroblock coded block pattern */
-const uint16_t ff_msmp4_mb_i_table[64][2] = {
- { 0x1, 1 }, { 0x17, 6 }, { 0x9, 5 }, { 0x5, 5 },
- { 0x6, 5 }, { 0x47, 9 }, { 0x20, 7 }, { 0x10, 7 },
- { 0x2, 5 }, { 0x7c, 9 }, { 0x3a, 7 }, { 0x1d, 7 },
- { 0x2, 6 }, { 0xec, 9 }, { 0x77, 8 }, { 0x0, 8 },
- { 0x3, 5 }, { 0xb7, 9 }, { 0x2c, 7 }, { 0x13, 7 },
- { 0x1, 6 }, { 0x168, 10 }, { 0x46, 8 }, { 0x3f, 8 },
- { 0x1e, 6 }, { 0x712, 13 }, { 0xb5, 9 }, { 0x42, 8 },
- { 0x22, 7 }, { 0x1c5, 11 }, { 0x11e, 10 }, { 0x87, 9 },
- { 0x6, 4 }, { 0x3, 9 }, { 0x1e, 7 }, { 0x1c, 6 },
- { 0x12, 7 }, { 0x388, 12 }, { 0x44, 9 }, { 0x70, 9 },
- { 0x1f, 6 }, { 0x23e, 11 }, { 0x39, 8 }, { 0x8e, 9 },
- { 0x1, 7 }, { 0x1c6, 11 }, { 0xb6, 9 }, { 0x45, 9 },
- { 0x14, 6 }, { 0x23f, 11 }, { 0x7d, 9 }, { 0x18, 9 },
- { 0x7, 7 }, { 0x1c7, 11 }, { 0x86, 9 }, { 0x19, 9 },
- { 0x15, 6 }, { 0x1db, 10 }, { 0x2, 9 }, { 0x46, 9 },
- { 0xd, 8 }, { 0x713, 13 }, { 0x1da, 10 }, { 0x169, 10 },
-};
-
/* non intra picture macroblock coded block pattern + mb type */
const uint32_t ff_table_mb_non_intra[128][2] = {
{ 0x40, 7 }, { 0x13c9, 13 }, { 0x9fd, 12 }, { 0x1fc, 15 },
@@ -124,142 +71,6 @@ const uint32_t ff_table_mb_non_intra[128][2] = {
{ 0x5, 5 }, { 0xb, 10 }, { 0x9c, 8 }, { 0xe, 10 },
};
-/* dc table 0 */
-
-const uint32_t ff_table0_dc_lum[120][2] = {
- { 0x1, 1 }, { 0x1, 2 }, { 0x1, 4 }, { 0x1, 5 },
- { 0x5, 5 }, { 0x7, 5 }, { 0x8, 6 }, { 0xc, 6 },
- { 0x0, 7 }, { 0x2, 7 }, { 0x12, 7 }, { 0x1a, 7 },
- { 0x3, 8 }, { 0x7, 8 }, { 0x27, 8 }, { 0x37, 8 },
- { 0x5, 9 }, { 0x4c, 9 }, { 0x6c, 9 }, { 0x6d, 9 },
- { 0x8, 10 }, { 0x19, 10 }, { 0x9b, 10 }, { 0x1b, 10 },
- { 0x9a, 10 }, { 0x13, 11 }, { 0x34, 11 }, { 0x35, 11 },
- { 0x61, 12 }, { 0x48, 13 }, { 0xc4, 13 }, { 0x4a, 13 },
- { 0xc6, 13 }, { 0xc7, 13 }, { 0x92, 14 }, { 0x18b, 14 },
- { 0x93, 14 }, { 0x183, 14 }, { 0x182, 14 }, { 0x96, 14 },
- { 0x97, 14 }, { 0x180, 14 }, { 0x314, 15 }, { 0x315, 15 },
- { 0x605, 16 }, { 0x604, 16 }, { 0x606, 16 }, { 0xc0e, 17 },
- { 0x303cd, 23 }, { 0x303c9, 23 }, { 0x303c8, 23 }, { 0x303ca, 23 },
- { 0x303cb, 23 }, { 0x303cc, 23 }, { 0x303ce, 23 }, { 0x303cf, 23 },
- { 0x303d0, 23 }, { 0x303d1, 23 }, { 0x303d2, 23 }, { 0x303d3, 23 },
- { 0x303d4, 23 }, { 0x303d5, 23 }, { 0x303d6, 23 }, { 0x303d7, 23 },
- { 0x303d8, 23 }, { 0x303d9, 23 }, { 0x303da, 23 }, { 0x303db, 23 },
- { 0x303dc, 23 }, { 0x303dd, 23 }, { 0x303de, 23 }, { 0x303df, 23 },
- { 0x303e0, 23 }, { 0x303e1, 23 }, { 0x303e2, 23 }, { 0x303e3, 23 },
- { 0x303e4, 23 }, { 0x303e5, 23 }, { 0x303e6, 23 }, { 0x303e7, 23 },
- { 0x303e8, 23 }, { 0x303e9, 23 }, { 0x303ea, 23 }, { 0x303eb, 23 },
- { 0x303ec, 23 }, { 0x303ed, 23 }, { 0x303ee, 23 }, { 0x303ef, 23 },
- { 0x303f0, 23 }, { 0x303f1, 23 }, { 0x303f2, 23 }, { 0x303f3, 23 },
- { 0x303f4, 23 }, { 0x303f5, 23 }, { 0x303f6, 23 }, { 0x303f7, 23 },
- { 0x303f8, 23 }, { 0x303f9, 23 }, { 0x303fa, 23 }, { 0x303fb, 23 },
- { 0x303fc, 23 }, { 0x303fd, 23 }, { 0x303fe, 23 }, { 0x303ff, 23 },
- { 0x60780, 24 }, { 0x60781, 24 }, { 0x60782, 24 }, { 0x60783, 24 },
- { 0x60784, 24 }, { 0x60785, 24 }, { 0x60786, 24 }, { 0x60787, 24 },
- { 0x60788, 24 }, { 0x60789, 24 }, { 0x6078a, 24 }, { 0x6078b, 24 },
- { 0x6078c, 24 }, { 0x6078d, 24 }, { 0x6078e, 24 }, { 0x6078f, 24 },
-};
-
-const uint32_t ff_table0_dc_chroma[120][2] = {
- { 0x0, 2 }, { 0x1, 2 }, { 0x5, 3 }, { 0x9, 4 },
- { 0xd, 4 }, { 0x11, 5 }, { 0x1d, 5 }, { 0x1f, 5 },
- { 0x21, 6 }, { 0x31, 6 }, { 0x38, 6 }, { 0x33, 6 },
- { 0x39, 6 }, { 0x3d, 6 }, { 0x61, 7 }, { 0x79, 7 },
- { 0x80, 8 }, { 0xc8, 8 }, { 0xca, 8 }, { 0xf0, 8 },
- { 0x81, 8 }, { 0xc0, 8 }, { 0xc9, 8 }, { 0x107, 9 },
- { 0x106, 9 }, { 0x196, 9 }, { 0x183, 9 }, { 0x1e3, 9 },
- { 0x1e2, 9 }, { 0x20a, 10 }, { 0x20b, 10 }, { 0x609, 11 },
- { 0x412, 11 }, { 0x413, 11 }, { 0x60b, 11 }, { 0x411, 11 },
- { 0x60a, 11 }, { 0x65f, 11 }, { 0x410, 11 }, { 0x65d, 11 },
- { 0x65e, 11 }, { 0xcb8, 12 }, { 0xc10, 12 }, { 0xcb9, 12 },
- { 0x1823, 13 }, { 0x3045, 14 }, { 0x6089, 15 }, { 0xc110, 16 },
- { 0x304448, 22 }, { 0x304449, 22 }, { 0x30444a, 22 }, { 0x30444b, 22 },
- { 0x30444c, 22 }, { 0x30444d, 22 }, { 0x30444e, 22 }, { 0x30444f, 22 },
- { 0x304450, 22 }, { 0x304451, 22 }, { 0x304452, 22 }, { 0x304453, 22 },
- { 0x304454, 22 }, { 0x304455, 22 }, { 0x304456, 22 }, { 0x304457, 22 },
- { 0x304458, 22 }, { 0x304459, 22 }, { 0x30445a, 22 }, { 0x30445b, 22 },
- { 0x30445c, 22 }, { 0x30445d, 22 }, { 0x30445e, 22 }, { 0x30445f, 22 },
- { 0x304460, 22 }, { 0x304461, 22 }, { 0x304462, 22 }, { 0x304463, 22 },
- { 0x304464, 22 }, { 0x304465, 22 }, { 0x304466, 22 }, { 0x304467, 22 },
- { 0x304468, 22 }, { 0x304469, 22 }, { 0x30446a, 22 }, { 0x30446b, 22 },
- { 0x30446c, 22 }, { 0x30446d, 22 }, { 0x30446e, 22 }, { 0x30446f, 22 },
- { 0x304470, 22 }, { 0x304471, 22 }, { 0x304472, 22 }, { 0x304473, 22 },
- { 0x304474, 22 }, { 0x304475, 22 }, { 0x304476, 22 }, { 0x304477, 22 },
- { 0x304478, 22 }, { 0x304479, 22 }, { 0x30447a, 22 }, { 0x30447b, 22 },
- { 0x30447c, 22 }, { 0x30447d, 22 }, { 0x30447e, 22 }, { 0x30447f, 22 },
- { 0x608880, 23 }, { 0x608881, 23 }, { 0x608882, 23 }, { 0x608883, 23 },
- { 0x608884, 23 }, { 0x608885, 23 }, { 0x608886, 23 }, { 0x608887, 23 },
- { 0x608888, 23 }, { 0x608889, 23 }, { 0x60888a, 23 }, { 0x60888b, 23 },
- { 0x60888c, 23 }, { 0x60888d, 23 }, { 0x60888e, 23 }, { 0x60888f, 23 },
-};
-
-/* dc table 1 */
-
-const uint32_t ff_table1_dc_lum[120][2] = {
- { 0x2, 2 }, { 0x3, 2 }, { 0x3, 3 }, { 0x2, 4 },
- { 0x5, 4 }, { 0x1, 5 }, { 0x3, 5 }, { 0x8, 5 },
- { 0x0, 6 }, { 0x5, 6 }, { 0xd, 6 }, { 0xf, 6 },
- { 0x13, 6 }, { 0x8, 7 }, { 0x18, 7 }, { 0x1c, 7 },
- { 0x24, 7 }, { 0x4, 8 }, { 0x6, 8 }, { 0x12, 8 },
- { 0x32, 8 }, { 0x3b, 8 }, { 0x4a, 8 }, { 0x4b, 8 },
- { 0xb, 9 }, { 0x26, 9 }, { 0x27, 9 }, { 0x66, 9 },
- { 0x74, 9 }, { 0x75, 9 }, { 0x14, 10 }, { 0x1c, 10 },
- { 0x1f, 10 }, { 0x1d, 10 }, { 0x2b, 11 }, { 0x3d, 11 },
- { 0x19d, 11 }, { 0x19f, 11 }, { 0x54, 12 }, { 0x339, 12 },
- { 0x338, 12 }, { 0x33d, 12 }, { 0xab, 13 }, { 0xf1, 13 },
- { 0x678, 13 }, { 0xf2, 13 }, { 0x1e0, 14 }, { 0x1e1, 14 },
- { 0x154, 14 }, { 0xcf2, 14 }, { 0x3cc, 15 }, { 0x2ab, 15 },
- { 0x19e7, 15 }, { 0x3ce, 15 }, { 0x19e6, 15 }, { 0x554, 16 },
- { 0x79f, 16 }, { 0x555, 16 }, { 0xf3d, 17 }, { 0xf37, 17 },
- { 0xf3c, 17 }, { 0xf35, 17 }, { 0x1e6d, 18 }, { 0x1e68, 18 },
- { 0x3cd8, 19 }, { 0x3cd3, 19 }, { 0x3cd9, 19 }, { 0x79a4, 20 },
- { 0xf34ba, 25 }, { 0xf34b4, 25 }, { 0xf34b5, 25 }, { 0xf34b6, 25 },
- { 0xf34b7, 25 }, { 0xf34b8, 25 }, { 0xf34b9, 25 }, { 0xf34bb, 25 },
- { 0xf34bc, 25 }, { 0xf34bd, 25 }, { 0xf34be, 25 }, { 0xf34bf, 25 },
- { 0x1e6940, 26 }, { 0x1e6941, 26 }, { 0x1e6942, 26 }, { 0x1e6943, 26 },
- { 0x1e6944, 26 }, { 0x1e6945, 26 }, { 0x1e6946, 26 }, { 0x1e6947, 26 },
- { 0x1e6948, 26 }, { 0x1e6949, 26 }, { 0x1e694a, 26 }, { 0x1e694b, 26 },
- { 0x1e694c, 26 }, { 0x1e694d, 26 }, { 0x1e694e, 26 }, { 0x1e694f, 26 },
- { 0x1e6950, 26 }, { 0x1e6951, 26 }, { 0x1e6952, 26 }, { 0x1e6953, 26 },
- { 0x1e6954, 26 }, { 0x1e6955, 26 }, { 0x1e6956, 26 }, { 0x1e6957, 26 },
- { 0x1e6958, 26 }, { 0x1e6959, 26 }, { 0x1e695a, 26 }, { 0x1e695b, 26 },
- { 0x1e695c, 26 }, { 0x1e695d, 26 }, { 0x1e695e, 26 }, { 0x1e695f, 26 },
- { 0x1e6960, 26 }, { 0x1e6961, 26 }, { 0x1e6962, 26 }, { 0x1e6963, 26 },
- { 0x1e6964, 26 }, { 0x1e6965, 26 }, { 0x1e6966, 26 }, { 0x1e6967, 26 },
-};
-
-const uint32_t ff_table1_dc_chroma[120][2] = {
- { 0x0, 2 }, { 0x1, 2 }, { 0x4, 3 }, { 0x7, 3 },
- { 0xb, 4 }, { 0xd, 4 }, { 0x15, 5 }, { 0x28, 6 },
- { 0x30, 6 }, { 0x32, 6 }, { 0x52, 7 }, { 0x62, 7 },
- { 0x66, 7 }, { 0xa6, 8 }, { 0xc6, 8 }, { 0xcf, 8 },
- { 0x14f, 9 }, { 0x18e, 9 }, { 0x19c, 9 }, { 0x29d, 10 },
- { 0x33a, 10 }, { 0x538, 11 }, { 0x63c, 11 }, { 0x63e, 11 },
- { 0x63f, 11 }, { 0x676, 11 }, { 0xa73, 12 }, { 0xc7a, 12 },
- { 0xcef, 12 }, { 0x14e5, 13 }, { 0x19dd, 13 }, { 0x29c8, 14 },
- { 0x29c9, 14 }, { 0x63dd, 15 }, { 0x33b8, 14 }, { 0x33b9, 14 },
- { 0xc7b6, 16 }, { 0x63d8, 15 }, { 0x63df, 15 }, { 0xc7b3, 16 },
- { 0xc7b4, 16 }, { 0xc7b5, 16 }, { 0x63de, 15 }, { 0xc7b7, 16 },
- { 0xc7b8, 16 }, { 0xc7b9, 16 }, { 0x18f65, 17 }, { 0x31ec8, 18 },
- { 0xc7b248, 24 }, { 0xc7b249, 24 }, { 0xc7b24a, 24 }, { 0xc7b24b, 24 },
- { 0xc7b24c, 24 }, { 0xc7b24d, 24 }, { 0xc7b24e, 24 }, { 0xc7b24f, 24 },
- { 0xc7b250, 24 }, { 0xc7b251, 24 }, { 0xc7b252, 24 }, { 0xc7b253, 24 },
- { 0xc7b254, 24 }, { 0xc7b255, 24 }, { 0xc7b256, 24 }, { 0xc7b257, 24 },
- { 0xc7b258, 24 }, { 0xc7b259, 24 }, { 0xc7b25a, 24 }, { 0xc7b25b, 24 },
- { 0xc7b25c, 24 }, { 0xc7b25d, 24 }, { 0xc7b25e, 24 }, { 0xc7b25f, 24 },
- { 0xc7b260, 24 }, { 0xc7b261, 24 }, { 0xc7b262, 24 }, { 0xc7b263, 24 },
- { 0xc7b264, 24 }, { 0xc7b265, 24 }, { 0xc7b266, 24 }, { 0xc7b267, 24 },
- { 0xc7b268, 24 }, { 0xc7b269, 24 }, { 0xc7b26a, 24 }, { 0xc7b26b, 24 },
- { 0xc7b26c, 24 }, { 0xc7b26d, 24 }, { 0xc7b26e, 24 }, { 0xc7b26f, 24 },
- { 0xc7b270, 24 }, { 0xc7b271, 24 }, { 0xc7b272, 24 }, { 0xc7b273, 24 },
- { 0xc7b274, 24 }, { 0xc7b275, 24 }, { 0xc7b276, 24 }, { 0xc7b277, 24 },
- { 0xc7b278, 24 }, { 0xc7b279, 24 }, { 0xc7b27a, 24 }, { 0xc7b27b, 24 },
- { 0xc7b27c, 24 }, { 0xc7b27d, 24 }, { 0xc7b27e, 24 }, { 0xc7b27f, 24 },
- { 0x18f6480, 25 }, { 0x18f6481, 25 }, { 0x18f6482, 25 }, { 0x18f6483, 25 },
- { 0x18f6484, 25 }, { 0x18f6485, 25 }, { 0x18f6486, 25 }, { 0x18f6487, 25 },
- { 0x18f6488, 25 }, { 0x18f6489, 25 }, { 0x18f648a, 25 }, { 0x18f648b, 25 },
- { 0x18f648c, 25 }, { 0x18f648d, 25 }, { 0x18f648e, 25 }, { 0x18f648f, 25 },
-};
-
/* vlc table 0, for intra luma */
static const uint16_t table0_vlc[133][2] = {
@@ -1833,40 +1644,6 @@ const uint8_t ff_old_ff_y_dc_scale_table[32] = {
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39
};
-const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64] = {
- { 0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
- 0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
- 0x30, 0x38, 0x29, 0x21, 0x1A, 0x13, 0x0C, 0x05,
- 0x06, 0x0D, 0x14, 0x1B, 0x22, 0x31, 0x39, 0x3A,
- 0x32, 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F,
- 0x16, 0x1D, 0x24, 0x2B, 0x33, 0x3B, 0x3C, 0x34,
- 0x2C, 0x25, 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x35,
- 0x3D, 0x3E, 0x36, 0x2E, 0x27, 0x2F, 0x37, 0x3F, },
- { 0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
- 0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
- 0x21, 0x30, 0x1A, 0x13, 0x0C, 0x05, 0x06, 0x0D,
- 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39, 0x2A,
- 0x23, 0x1C, 0x15, 0x0E, 0x07, 0x0F, 0x16, 0x1D,
- 0x24, 0x2B, 0x32, 0x3A, 0x33, 0x3B, 0x2C, 0x25,
- 0x1E, 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3C, 0x35,
- 0x3D, 0x2E, 0x27, 0x2F, 0x36, 0x3E, 0x37, 0x3F, },
- { 0x00, 0x01, 0x08, 0x02, 0x03, 0x09, 0x10, 0x18,
- 0x11, 0x0A, 0x04, 0x05, 0x0B, 0x12, 0x19, 0x20,
- 0x28, 0x30, 0x21, 0x1A, 0x13, 0x0C, 0x06, 0x07,
- 0x0D, 0x14, 0x1B, 0x22, 0x29, 0x38, 0x31, 0x39,
- 0x2A, 0x23, 0x1C, 0x15, 0x0E, 0x0F, 0x16, 0x1D,
- 0x24, 0x2B, 0x32, 0x3A, 0x33, 0x2C, 0x25, 0x1E,
- 0x17, 0x1F, 0x26, 0x2D, 0x34, 0x3B, 0x3C, 0x35,
- 0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F, },
- { 0x00, 0x08, 0x10, 0x01, 0x18, 0x20, 0x28, 0x09,
- 0x02, 0x03, 0x0A, 0x11, 0x19, 0x30, 0x38, 0x29,
- 0x21, 0x1A, 0x12, 0x0B, 0x04, 0x05, 0x0C, 0x13,
- 0x1B, 0x22, 0x31, 0x39, 0x32, 0x2A, 0x23, 0x1C,
- 0x14, 0x0D, 0x06, 0x07, 0x0E, 0x15, 0x1D, 0x24,
- 0x2B, 0x33, 0x3A, 0x3B, 0x34, 0x2C, 0x25, 0x1E,
- 0x16, 0x0F, 0x17, 0x1F, 0x26, 0x2D, 0x3C, 0x35,
- 0x2E, 0x27, 0x2F, 0x36, 0x3D, 0x3E, 0x37, 0x3F, }
-};
const uint8_t ff_table_inter_intra[4][2] = {
{ 0, 1 } /* Luma-Left Chroma-Left */,
diff --git a/libavcodec/msmpeg4data.h b/libavcodec/msmpeg4data.h
index ccbfde36f7..26ee960f82 100644
--- a/libavcodec/msmpeg4data.h
+++ b/libavcodec/msmpeg4data.h
@@ -48,21 +48,6 @@ typedef struct MVTable {
} MVTable;
FF_VISIBILITY_PUSH_HIDDEN
-void ff_msmp4_vc1_vlcs_init_once(void);
-
-#define MSMP4_MB_INTRA_VLC_BITS 9
-extern VLC ff_msmp4_mb_i_vlc;
-#define MSMP4_DC_VLC_BITS 9
-extern VLC ff_msmp4_dc_luma_vlc[2];
-extern VLC ff_msmp4_dc_chroma_vlc[2];
-
-/* intra picture macroblock coded block pattern */
-extern const uint16_t ff_msmp4_mb_i_table[64][2];
-
-#define WMV1_SCANTABLE_COUNT 4
-
-extern const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64];
-
#define NB_RL_TABLES 6
extern RLTable ff_rl_table[NB_RL_TABLES];
@@ -83,11 +68,6 @@ extern const uint8_t ff_v2_intra_cbpc[4][2];
extern const uint32_t ff_table_mb_non_intra[128][2];
extern const uint8_t ff_table_inter_intra[4][2];
-extern const uint32_t ff_table0_dc_lum[120][2];
-extern const uint32_t ff_table1_dc_lum[120][2];
-extern const uint32_t ff_table0_dc_chroma[120][2];
-extern const uint32_t ff_table1_dc_chroma[120][2];
-
#define WMV2_INTER_CBP_TABLE_COUNT 4
extern const uint32_t (* const ff_wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2];
FF_VISIBILITY_POP_HIDDEN
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index 2be8cf2bf6..dbcec3de74 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -36,6 +36,7 @@
#include "h263dec.h"
#include "mpeg4videodec.h"
#include "msmpeg4data.h"
+#include "msmpeg4_vc1_data.h"
#define V2_INTRA_CBPC_VLC_BITS 3
#define V2_MB_TYPE_VLC_BITS 7
diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c
index f0d0045e69..9b6e5efa0c 100644
--- a/libavcodec/msmpeg4enc.c
+++ b/libavcodec/msmpeg4enc.c
@@ -41,6 +41,7 @@
#include "mpeg4video.h"
#include "msmpeg4.h"
#include "msmpeg4data.h"
+#include "msmpeg4_vc1_data.h"
#include "msmpeg4enc.h"
#include "put_bits.h"
#include "rl.h"
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index 9293c509cb..c6882163a1 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -30,7 +30,7 @@
#include "mpegutils.h"
#include "mpegvideo.h"
#include "mpegvideodec.h"
-#include "msmpeg4data.h"
+#include "msmpeg4_vc1_data.h"
#include "unary.h"
#include "vc1.h"
#include "vc1_pred.h"
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 1cf42d831f..b50f5b45aa 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -37,7 +37,7 @@
#include "mpeg_er.h"
#include "mpegvideo.h"
#include "mpegvideodec.h"
-#include "msmpeg4data.h"
+#include "msmpeg4_vc1_data.h"
#include "msmpeg4dec.h"
#include "profiles.h"
#include "simple_idct.h"
diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c
index 543784c813..e3d3288d33 100644
--- a/libavcodec/wmv2.c
+++ b/libavcodec/wmv2.c
@@ -21,7 +21,7 @@
#include "avcodec.h"
#include "idctdsp.h"
#include "mpegvideo.h"
-#include "msmpeg4data.h"
+#include "msmpeg4_vc1_data.h"
#include "wmv2.h"
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 1209b1902d..469b2c4b2b 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -28,7 +28,7 @@
#include "mpegutils.h"
#include "mpegvideo.h"
#include "msmpeg4.h"
-#include "msmpeg4data.h"
+#include "msmpeg4_vc1_data.h"
#include "msmpeg4dec.h"
#include "simple_idct.h"
#include "wmv2.h"
diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c
index d2f8afc892..05f993525d 100644
--- a/libavcodec/wmv2enc.c
+++ b/libavcodec/wmv2enc.c
@@ -26,6 +26,7 @@
#include "msmpeg4.h"
#include "msmpeg4enc.h"
#include "msmpeg4data.h"
+#include "msmpeg4_vc1_data.h"
#include "wmv2.h"
#include "wmv2enc.h"
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 18/19] avcodec/vc1dec: Split VC-1 decoders from msmpeg4
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (15 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 17/19] avcodec/msmpeg4data: Move data shared between msmpeg4 and VC-1 out Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 19/19] avcodec/vc1_block: Remove redundant write Andreas Rheinhardt
` (6 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The only msmpeg4 code that is ever executed by the VC-1 based
decoders is ff_msmpeg4_decode_init() and what is directly
reachable from it. This is:
a) A call to av_image_check_size(), then ff_h263_decode_init(),
b) followed by setting [yc]_dc_scale_table and initializing
scantable/permutations.
c) Afterwards, some static tables are initialized.
d) Finally, slice_height is set.
The replacement for ff_msmpeg4_decode_init() performs a)
just like now; it also sets [yc]_dc_scale_table,
but it only initializes inter_scantable and intra_scantable
and not permutated_intra_[hv]_scantable: The latter are only
used inside decode_mb callbacks which are only called
in ff_h263_decode_frame() which is unused for VC-1.*
The static tables initialized in c) are not used at all by
VC-1 (the ones that are used have been factored out in
previous commits); this avoids touching 327KiB of .bss.
slice_height is also not used by the VC-1 decoder (setting
it in ff_msmpeg4_decode_init() is probably redundant after
b34397b4cd780b5692548e7d021ec884c7217dba).
*: It follows from this that the VC-1 decoder is not really
based upon the H.263 decoder either; changing this will
be done in a future commit.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
configure | 2 +-
libavcodec/msmpeg4.c | 12 ------------
libavcodec/msmpeg4dec.c | 3 ---
libavcodec/vc1dec.c | 20 ++++++++++++++++++--
4 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/configure b/configure
index 70c9e41dcc..545975c575 100755
--- a/configure
+++ b/configure
@@ -2981,7 +2981,7 @@ utvideo_encoder_select="bswapdsp huffman llvidencdsp"
vble_decoder_select="llviddsp"
vbn_decoder_select="texturedsp"
vbn_encoder_select="texturedspenc"
-vc1_decoder_select="blockdsp h264qpel intrax8 mpegvideodec msmpeg4dec vc1dsp"
+vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 mpegvideodec vc1dsp"
vc1image_decoder_select="vc1_decoder"
vorbis_decoder_select="mdct"
vorbis_encoder_select="audio_frame_queue mdct"
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 4daf1666cc..a2c4c57728 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -27,8 +27,6 @@
* MSMPEG4 backend for encoder and decoder
*/
-#include "config_components.h"
-
#include "libavutil/thread.h"
#include "avcodec.h"
@@ -40,8 +38,6 @@
#include "msmpeg4data.h"
#include "msmpeg4_vc1_data.h"
#include "mpegvideodata.h"
-#include "vc1data.h"
-#include "libavutil/imgutils.h"
/*
* You can also call this codec: MPEG-4 with a twist!
@@ -139,16 +135,8 @@ av_cold void ff_msmpeg4_common_init(MpegEncContext *s)
s->y_dc_scale_table= ff_wmv1_y_dc_scale_table;
s->c_dc_scale_table= ff_wmv1_c_dc_scale_table;
break;
-#if CONFIG_VC1_DECODER
- case 6:
- s->y_dc_scale_table= ff_wmv3_dc_scale_table;
- s->c_dc_scale_table= ff_wmv3_dc_scale_table;
- break;
-#endif
-
}
-
if(s->msmpeg4_version>=4){
ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_wmv1_scantable[1]);
ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable, ff_wmv1_scantable[0]);
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index dbcec3de74..26a196a38f 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -373,9 +373,6 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
break;
case 5:
break;
- case 6:
- //FIXME + TODO VC1 decode mb
- break;
}
s->slice_height= s->mb_height; //to avoid 1/0 if the first frame is not a keyframe
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index b50f5b45aa..bcfd2bae0b 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -33,12 +33,12 @@
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
+#include "h263dec.h"
#include "hwconfig.h"
#include "mpeg_er.h"
#include "mpegvideo.h"
#include "mpegvideodec.h"
#include "msmpeg4_vc1_data.h"
-#include "msmpeg4dec.h"
#include "profiles.h"
#include "simple_idct.h"
#include "vc1.h"
@@ -46,6 +46,7 @@
#include "vc1_vlc_data.h"
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
#include "libavutil/thread.h"
@@ -406,11 +407,26 @@ static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
av_cold int ff_vc1_decode_init(AVCodecContext *avctx)
{
- int ret = ff_msmpeg4_decode_init(avctx);
VC1Context *const v = avctx->priv_data;
+ MpegEncContext *const s = &v->s;
+ int ret;
+
+ ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
if (ret < 0)
return ret;
+ ret = ff_h263_decode_init(avctx);
+ if (ret < 0)
+ return ret;
+
+ s->y_dc_scale_table = ff_wmv3_dc_scale_table;
+ s->c_dc_scale_table = ff_wmv3_dc_scale_table;
+
+ ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable,
+ ff_wmv1_scantable[0]);
+ ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable,
+ ff_wmv1_scantable[1]);
+
ret = vc1_decode_init_alloc_tables(v);
if (ret < 0) {
ff_vc1_decode_end(avctx);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 19/19] avcodec/vc1_block: Remove redundant write
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (16 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 18/19] avcodec/vc1dec: Split VC-1 decoders from msmpeg4 Andreas Rheinhardt
@ 2022-10-30 23:56 ` Andreas Rheinhardt
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 20/24] avcodec/mpegvideo_dec: Don't use MotionEstContext as scratch space Andreas Rheinhardt
` (5 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-10-30 23:56 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
vc1_decode_skip_blocks() is only called if the current picture
is a P frame. So setting pict_type to AV_PICTURE_TYPE_P
is redundant; removing it makes pict_type read-only in vc1_block.c
(as it should be).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1_block.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index c6882163a1..1baa6a9bf6 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -2977,7 +2977,6 @@ static void vc1_decode_skip_blocks(VC1Context *v)
memcpy(s->dest[2], s->last_picture.f->data[2] + s->mb_y * 8 * s->uvlinesize, s->uvlinesize * 8);
s->first_slice_line = 0;
}
- s->pict_type = AV_PICTURE_TYPE_P;
}
void ff_vc1_decode_blocks(VC1Context *v)
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 20/24] avcodec/mpegvideo_dec: Don't use MotionEstContext as scratch space
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (17 preceding siblings ...)
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 19/19] avcodec/vc1_block: Remove redundant write Andreas Rheinhardt
@ 2022-11-03 2:57 ` Andreas Rheinhardt
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 21/24] avcodec/vc1dec: Remove VC-1 decoders->H.263 decoder dependency Andreas Rheinhardt
` (4 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-11-03 2:57 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Decoders that might use quarter pixel motion estimation
(namely MPEG-4 as well as the VC-1 family) currently
use MpegEncContext.me.qpel_(put|avg) as scratch space
for pointers to arrays of function pointers.
(MotionEstContext contains such pointers as it supports
quarter pixel motion estimation.) The MotionEstContext
is unused apart from this for the decoding part of
mpegvideo.
Using the context at all is for decoding is actually
unnecessary and easily avoided: All codecs with
quarter pixels set me.qpel_avg to qdsp.avg_qpel_pixels_tab,
so one can just unconditionally use this in ff_mpv_reconstruct_mb().
MPEG-4 sets qpel_put to qdsp.put_qpel_pixels_tab
or to qdsp.put_no_rnd_qpel_pixels_tab based upon
whether the current frame is a b-frame with no_rounding
or not, while the VC-1-based decoders set it to
qdsp.put_qpel_pixels_tab unconditionally. Given
that no_rounding is always zero for VC-1, using
the same check for VC-1 as well as for MPEG-4 would work.
Since ff_mpv_reconstruct_mb() already has exactly
the right check (for hpeldsp), it can simply be reused.
(This change will result in ff_mpv_motion() receiving
a pointer to an array of NULL function pointers instead
of a NULL pointer for codecs without qpeldsp (like MPEG-1/2).
It doesn't matter.)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h263dec.c | 8 --------
libavcodec/mpv_reconstruct_mb_template.c | 6 ++++--
libavcodec/mss2.c | 4 ----
libavcodec/vc1dec.c | 3 ---
4 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 90dd32bd3a..5f5ecfdddc 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -597,14 +597,6 @@ retry:
avctx->skip_frame >= AVDISCARD_ALL)
return get_consumed_bytes(s, buf_size);
- if ((!s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) {
- s->me.qpel_put = s->qdsp.put_qpel_pixels_tab;
- s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab;
- } else {
- s->me.qpel_put = s->qdsp.put_no_rnd_qpel_pixels_tab;
- s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab;
- }
-
if ((ret = ff_mpv_frame_start(s, avctx)) < 0)
return ret;
diff --git a/libavcodec/mpv_reconstruct_mb_template.c b/libavcodec/mpv_reconstruct_mb_template.c
index 5023fe58ae..6f7a5fb1b4 100644
--- a/libavcodec/mpv_reconstruct_mb_template.c
+++ b/libavcodec/mpv_reconstruct_mb_template.c
@@ -145,17 +145,19 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64],
}
} else {
op_pixels_func (*op_pix)[4];
- qpel_mc_func (*op_qpix)[16] = s->me.qpel_put;
+ qpel_mc_func (*op_qpix)[16];
if ((is_mpeg12 == DEFINITELY_MPEG12 || !s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) {
op_pix = s->hdsp.put_pixels_tab;
+ op_qpix = s->qdsp.put_qpel_pixels_tab;
} else {
op_pix = s->hdsp.put_no_rnd_pixels_tab;
+ op_qpix = s->qdsp.put_no_rnd_qpel_pixels_tab;
}
if (s->mv_dir & MV_DIR_FORWARD) {
ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.f->data, op_pix, op_qpix);
op_pix = s->hdsp.avg_pixels_tab;
- op_qpix = s->me.qpel_avg;
+ op_qpix = s->qdsp.avg_qpel_pixels_tab;
}
if (s->mv_dir & MV_DIR_BACKWARD) {
ff_mpv_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.f->data, op_pix, op_qpix);
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index 2469718c8f..1d1ed11f54 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -855,10 +855,6 @@ static av_cold int wmv9_init(AVCodecContext *avctx)
if (ret < 0)
return ret;
- /* error concealment */
- v->s.me.qpel_put = v->s.qdsp.put_qpel_pixels_tab;
- v->s.me.qpel_avg = v->s.qdsp.avg_qpel_pixels_tab;
-
return 0;
}
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index bcfd2bae0b..e7ad540d84 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1060,9 +1060,6 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict,
s->current_picture_ptr->f->repeat_pict = v->rptfrm * 2;
}
- s->me.qpel_put = s->qdsp.put_qpel_pixels_tab;
- s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab;
-
if (avctx->hwaccel) {
s->mb_y = 0;
if (v->field_mode && buf_start_second_field) {
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 21/24] avcodec/vc1dec: Remove VC-1 decoders->H.263 decoder dependency
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (18 preceding siblings ...)
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 20/24] avcodec/mpegvideo_dec: Don't use MotionEstContext as scratch space Andreas Rheinhardt
@ 2022-11-03 2:57 ` Andreas Rheinhardt
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 22/24] avcodec/h263dec: Move initializing qpel DSP context to mpeg4videodec.c Andreas Rheinhardt
` (3 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-11-03 2:57 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The only thing from the H.263 decoder that is reachable
by the VC-1 decoder is ff_h263_decode_init(); but it does
not even use all of it; e.g. h263dsp is unused and so are
the VLCs initialized in ff_h263_decode_init() (they amount
to about 77KB which are now no longer touched).
Notice that one could also call ff_idctdsp_init()
directly instead of ff_mpv_idct_init(); one could even
do so in ff_vc1_init_common().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
configure | 2 +-
libavcodec/h263dec.c | 12 ------------
libavcodec/vc1dec.c | 32 ++++++++++++++++++++++++++++++--
3 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/configure b/configure
index 0822498efe..a59e9a898d 100755
--- a/configure
+++ b/configure
@@ -2981,7 +2981,7 @@ utvideo_encoder_select="bswapdsp huffman llvidencdsp"
vble_decoder_select="llviddsp"
vbn_decoder_select="texturedsp"
vbn_encoder_select="texturedspenc"
-vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 mpegvideodec vc1dsp"
+vc1_decoder_select="blockdsp h264qpel intrax8 mpegvideodec qpeldsp vc1dsp"
vc1image_decoder_select="vc1_decoder"
vorbis_decoder_select="mdct"
vorbis_encoder_select="audio_frame_queue mdct"
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 5f5ecfdddc..da3c9899e3 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -63,9 +63,6 @@ static enum AVPixelFormat h263_get_format(AVCodecContext *avctx)
return avctx->pix_fmt;
}
- if (avctx->codec->id == AV_CODEC_ID_MSS2)
- return AV_PIX_FMT_YUV420P;
-
if (CONFIG_GRAY && (avctx->flags & AV_CODEC_FLAG_GRAY)) {
if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
avctx->color_range = AVCOL_RANGE_MPEG;
@@ -117,15 +114,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
s->h263_pred = 1;
s->msmpeg4_version = 5;
break;
- case AV_CODEC_ID_VC1:
- case AV_CODEC_ID_WMV3:
- case AV_CODEC_ID_VC1IMAGE:
- case AV_CODEC_ID_WMV3IMAGE:
- case AV_CODEC_ID_MSS2:
- s->h263_pred = 1;
- s->msmpeg4_version = 6;
- avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
- break;
case AV_CODEC_ID_H263I:
break;
case AV_CODEC_ID_FLV1:
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index e7ad540d84..5cb4c544c9 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -405,6 +405,20 @@ static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
return 0;
}
+static enum AVPixelFormat vc1_get_format(AVCodecContext *avctx)
+{
+ if (avctx->codec_id == AV_CODEC_ID_MSS2)
+ return AV_PIX_FMT_YUV420P;
+
+ if (CONFIG_GRAY && (avctx->flags & AV_CODEC_FLAG_GRAY)) {
+ if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
+ avctx->color_range = AVCOL_RANGE_MPEG;
+ return AV_PIX_FMT_GRAY8;
+ }
+
+ return ff_get_format(avctx, avctx->codec->pix_fmts);
+}
+
av_cold int ff_vc1_decode_init(AVCodecContext *avctx)
{
VC1Context *const v = avctx->priv_data;
@@ -415,7 +429,12 @@ av_cold int ff_vc1_decode_init(AVCodecContext *avctx)
if (ret < 0)
return ret;
- ret = ff_h263_decode_init(avctx);
+ ff_mpv_decode_init(s, avctx);
+ ff_mpv_idct_init(s);
+
+ avctx->pix_fmt = vc1_get_format(avctx);
+
+ ret = ff_mpv_common_init(s);
if (ret < 0)
return ret;
@@ -578,13 +597,23 @@ static av_cold void vc1_init_static(void)
av_cold void ff_vc1_init_common(VC1Context *v)
{
static AVOnce init_static_once = AV_ONCE_INIT;
+ MpegEncContext *const s = &v->s;
/* defaults */
v->pq = -1;
v->mvrange = 0; /* 7.1.1.18, p80 */
+ s->avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
+ s->out_format = FMT_H263;
+
+ s->h263_pred = 1;
+ s->msmpeg4_version = 6;
+
ff_vc1dsp_init(&v->vc1dsp);
+ /* For error resilience */
+ ff_qpeldsp_init(&s->qdsp);
+
/* VLC tables */
ff_thread_once(&init_static_once, vc1_init_static);
}
@@ -702,7 +731,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
ff_blockdsp_init(&s->bdsp);
ff_h264chroma_init(&v->h264chroma, 8);
- ff_qpeldsp_init(&s->qdsp);
avctx->has_b_frames = !!avctx->max_b_frames;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 22/24] avcodec/h263dec: Move initializing qpel DSP context to mpeg4videodec.c
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (19 preceding siblings ...)
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 21/24] avcodec/vc1dec: Remove VC-1 decoders->H.263 decoder dependency Andreas Rheinhardt
@ 2022-11-03 2:57 ` Andreas Rheinhardt
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 23/24] avcodec/mpegvideo_enc: Move initializing QpelDSPCtx to mpeg4videoenc.c Andreas Rheinhardt
` (2 subsequent siblings)
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-11-03 2:57 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The MPEG-4 decoder is the only decoder based upon H.263 that
supports quarterpel motion vectors.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/h263dec.c | 2 --
libavcodec/mpeg4videodec.c | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index da3c9899e3..71b846ba74 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -51,7 +51,6 @@
#include "mpegvideo.h"
#include "mpegvideodec.h"
#include "msmpeg4dec.h"
-#include "qpeldsp.h"
#include "thread.h"
#include "wmv2dec.h"
@@ -140,7 +139,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
}
ff_h263dsp_init(&s->h263dsp);
- ff_qpeldsp_init(&s->qdsp);
ff_h263_decode_init_vlc();
return 0;
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 4ab558b46f..f91d2753f9 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -43,6 +43,7 @@
#include "h263data.h"
#include "h263dec.h"
#include "profiles.h"
+#include "qpeldsp.h"
#include "threadframe.h"
#include "xvididct.h"
#include "unary.h"
@@ -3824,6 +3825,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
+ ff_qpeldsp_init(&s->qdsp);
ff_mpeg4videodsp_init(&ctx->mdsp);
ff_thread_once(&init_static_once, mpeg4_init_static);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 23/24] avcodec/mpegvideo_enc: Move initializing QpelDSPCtx to mpeg4videoenc.c
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (20 preceding siblings ...)
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 22/24] avcodec/h263dec: Move initializing qpel DSP context to mpeg4videodec.c Andreas Rheinhardt
@ 2022-11-03 2:57 ` Andreas Rheinhardt
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 24/24] avcodec/motion_est: Remove unused field Andreas Rheinhardt
2022-11-05 17:18 ` [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-11-03 2:57 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is the only encoder supporting quarter samples.
This also allows to remove the qpeldsp dependency from
mpegvideo_enc.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
configure | 4 ++--
libavcodec/mpeg4videoenc.c | 1 +
libavcodec/mpegvideo_enc.c | 1 -
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index a59e9a898d..1127f49a62 100755
--- a/configure
+++ b/configure
@@ -2756,7 +2756,7 @@ mpegaudio_select="mpegaudiodsp mpegaudioheader"
mpegaudiodsp_select="dct"
mpegvideo_select="blockdsp hpeldsp idctdsp videodsp"
mpegvideodec_select="h264chroma mpegvideo mpeg_er"
-mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp qpeldsp"
+mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp"
msmpeg4dec_select="h263_decoder"
msmpeg4enc_select="h263_encoder"
vc1dsp_select="h264chroma qpeldsp startcode"
@@ -2903,7 +2903,7 @@ mpeg1video_encoder_select="mpegvideoenc"
mpeg2video_decoder_select="mpegvideodec"
mpeg2video_encoder_select="mpegvideoenc"
mpeg4_decoder_select="h263_decoder mpeg4video_parser"
-mpeg4_encoder_select="h263_encoder"
+mpeg4_encoder_select="h263_encoder qpeldsp"
msa1_decoder_select="mss34dsp"
mscc_decoder_select="inflate_wrapper"
msmpeg4v1_decoder_select="msmpeg4dec"
diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index 77f960a262..a2a14afbd0 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -1287,6 +1287,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
+ ff_qpeldsp_init(&s->qdsp);
if ((ret = ff_mpv_encode_init(avctx)) < 0)
return ret;
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 1bcc849782..9b11c5c05a 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -807,7 +807,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
ff_me_cmp_init(&s->mecc, avctx);
ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx);
ff_pixblockdsp_init(&s->pdsp, avctx);
- ff_qpeldsp_init(&s->qdsp);
if (!(avctx->stats_out = av_mallocz(256)) ||
!FF_ALLOCZ_TYPED_ARRAY(s->q_intra_matrix, 32) ||
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* [FFmpeg-devel] [PATCH 24/24] avcodec/motion_est: Remove unused field
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (21 preceding siblings ...)
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 23/24] avcodec/mpegvideo_enc: Move initializing QpelDSPCtx to mpeg4videoenc.c Andreas Rheinhardt
@ 2022-11-03 2:57 ` Andreas Rheinhardt
2022-11-05 17:18 ` [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-11-03 2:57 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/motion_est.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/libavcodec/motion_est.h b/libavcodec/motion_est.h
index b20cdabbbb..f6a563b08c 100644
--- a/libavcodec/motion_est.h
+++ b/libavcodec/motion_est.h
@@ -52,7 +52,6 @@ typedef struct MotionEstContext {
uint8_t *scratchpad; /**< data area for the ME algo, so that
* the ME does not need to malloc/free. */
uint8_t *temp;
- int best_bits;
uint32_t *map; ///< map to avoid duplicate evaluations
uint32_t *score_map; ///< map to store the scores
unsigned map_generation;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
` (22 preceding siblings ...)
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 24/24] avcodec/motion_est: Remove unused field Andreas Rheinhardt
@ 2022-11-05 17:18 ` Andreas Rheinhardt
23 siblings, 0 replies; 25+ messages in thread
From: Andreas Rheinhardt @ 2022-11-05 17:18 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> This check has been added in c617bed34f39a122ab1f89581ddce9cc63885383,
> merging ee769c6a7c1d4ec6560f5e5a6f457b770b10fb33 to fix
> a possible segfault if AVCodecContext.codec is not set
> as it may be during parsing. While this fixes the segfault,
> it has the unfortunate side effect that it makes the output
> of the parser dependent on whether a decoder is set (and
> ultimately available). The fix later applied in
> 5d2be71b9ecf2a88752666a2c4039f4d98419d35 does not have this
> downside and makes checking AVCodecContext.codec superfluous.
> So remove this check.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/vc1.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
> index c9257b290f..f6de8b9e75 100644
> --- a/libavcodec/vc1.c
> +++ b/libavcodec/vc1.c
> @@ -632,8 +632,6 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
> v->fcm = PROGRESSIVE;
> if (v->finterpflag)
> v->interpfrm = get_bits1(gb);
> - if (!v->s.avctx->codec)
> - return -1;
> if (v->s.avctx->codec_id == AV_CODEC_ID_MSS2)
> v->respic =
> v->rangered =
Will apply this patchset tomorrow unless there are objections.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2022-11-05 17:18 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-30 23:41 [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 02/19] avcodec/vc1: Remove always-false check Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 03/19] avcodec/vc1: Don't check for errors for complete VLC Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 04/19] avcodec/vc1: Don't use VLC to read bfraction Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 05/19] avcodec/vc1_parser: Set parse_only only once Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 06/19] avcodec/vc1_parser: Don't call ff_vc1_init_common() Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 07/19] avcodec/vc1: Move setting res_fasttx-IDCT functions to vc1dec.c Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 08/19] avcodec/vc1data: Remove duplicate defines Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 09/19] avcodec/vc1data: Remove declarations of inexistent arrays Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 10/19] avcodec/vc1data: Move VLC codes/lengths tables to a header Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 11/19] avcodec/vc1: Move ff_vc1_init_common() to vc1dec.c Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 12/19] avcodec/vc1_block: Don't duplicate #defines Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 13/19] avcodec/msmpeg4dec: Factor initializing VLCs shared with VC-1 out Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 14/19] avcodec/vc1dec: Don't open and close decoder during init Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 15/19] avcodec/vc1dec: Factor (re)initializing code out Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 16/19] avcodec/vc1dec: Return early upon error Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 17/19] avcodec/msmpeg4data: Move data shared between msmpeg4 and VC-1 out Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 18/19] avcodec/vc1dec: Split VC-1 decoders from msmpeg4 Andreas Rheinhardt
2022-10-30 23:56 ` [FFmpeg-devel] [PATCH 19/19] avcodec/vc1_block: Remove redundant write Andreas Rheinhardt
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 20/24] avcodec/mpegvideo_dec: Don't use MotionEstContext as scratch space Andreas Rheinhardt
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 21/24] avcodec/vc1dec: Remove VC-1 decoders->H.263 decoder dependency Andreas Rheinhardt
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 22/24] avcodec/h263dec: Move initializing qpel DSP context to mpeg4videodec.c Andreas Rheinhardt
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 23/24] avcodec/mpegvideo_enc: Move initializing QpelDSPCtx to mpeg4videoenc.c Andreas Rheinhardt
2022-11-03 2:57 ` [FFmpeg-devel] [PATCH 24/24] avcodec/motion_est: Remove unused field Andreas Rheinhardt
2022-11-05 17:18 ` [FFmpeg-devel] [PATCH 01/19] avcodec/vc1: Don't check for AVCodecContext.codec Andreas Rheinhardt
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git