ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Wed Apr  9 16:30:57 2025 +0200| [12c9ffa569a026081453234d58a636a6d7e34d57] | 
committer: Andreas Rheinhardt

avcodec/hq: Include alpha in cbp VLC table

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=12c9ffa569a026081453234d58a636a6d7e34d57
---

 libavcodec/hq_common.c | 2 +-
 libavcodec/hq_hqa.c    | 1 -
 libavcodec/hqx.c       | 2 --
 3 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavcodec/hq_common.c b/libavcodec/hq_common.c
index 7235dcb63f..9f56c819f3 100644
--- a/libavcodec/hq_common.c
+++ b/libavcodec/hq_common.c
@@ -19,7 +19,7 @@
 #include "hq_common.h"
 
 #define REPEAT(x) x x
-#define ELEM(_sym, _len) {.sym = _sym, .len = _len },
+#define ELEM(_sym, _len) {.sym = _sym << 4 | _sym, .len = _len },
 #define LEN5(sym) ELEM(sym, 5)
 #define LEN4(sym) REPEAT(ELEM(sym, 4))
 #define LEN2(sym) REPEAT(REPEAT(REPEAT(ELEM(sym, 2))))
diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c
index 76af754115..48fc4896ee 100644
--- a/libavcodec/hq_hqa.c
+++ b/libavcodec/hq_hqa.c
@@ -206,7 +206,6 @@ static int hqa_decode_mb(HQContext *c, AVFrame *pic, int 
qgroup,
     if (cbp) {
         flag = get_bits1(gb);
 
-        cbp |= cbp << 4;
         if (cbp & 0x3)
             cbp |= 0x500;
         if (cbp & 0xC)
diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c
index 0819575aa4..9ec6672580 100644
--- a/libavcodec/hqx.c
+++ b/libavcodec/hqx.c
@@ -234,7 +234,6 @@ static int hqx_decode_422a(HQXContext *ctx, int slice_no, 
int x, int y)
 
         quants = hqx_quants[get_bits(gb, 4)];
 
-        cbp |= cbp << 4; // alpha CBP
         if (cbp & 0x3)   // chroma CBP - top
             cbp |= 0x500;
         if (cbp & 0xC)   // chroma CBP - bottom
@@ -319,7 +318,6 @@ static int hqx_decode_444a(HQXContext *ctx, int slice_no, 
int x, int y)
 
         quants = hqx_quants[get_bits(gb, 4)];
 
-        cbp |= cbp << 4; // alpha CBP
         cbp |= cbp << 8; // chroma CBP
         for (i = 0; i < 16; i++) {
             if (!(i & 3))

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to