Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] cfhd decoder fixes for old codebook
@ 2022-09-03  9:09 Paul B Mahol
  2022-09-03 11:01 ` Kieran Kunhya
  0 siblings, 1 reply; 2+ messages in thread
From: Paul B Mahol @ 2022-09-03  9:09 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 10 bytes --]

Attached.

[-- Attachment #2: 0001-avcodec-cfhddata-remove-unused-defines.patch --]
[-- Type: text/x-patch, Size: 882 bytes --]

From 485600a2bd216a92b7035caaa1992dd5a9438848 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 3 Sep 2022 09:23:39 +0200
Subject: [PATCH 1/2] avcodec/cfhddata: remove unused defines

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/cfhddata.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/libavcodec/cfhddata.c b/libavcodec/cfhddata.c
index 55c8004bdd..8079fdf542 100644
--- a/libavcodec/cfhddata.c
+++ b/libavcodec/cfhddata.c
@@ -24,14 +24,6 @@
 
 #include "cfhd.h"
 
-/* some special codewords, not sure what they all mean */
-#define TABLE_9_BAND_END1 0x1C7859Eh
-#define TABLE_9_BAND_END_LEN1 25
-#define TABLE_9_BAND_END2 0x38F0B3Fh
-#define TABLE_9_BAND_END_LEN2 26
-#define TABLE_9_BAND_END3 0x38F0B3Eh
-#define TABLE_9_BAND_END_LEN3 26
-
 #define NB_VLC_TABLE_9   (71 + 3)
 #define NB_VLC_TABLE_18 (263 + 1)
 
-- 
2.37.2


[-- Attachment #3: 0002-avcodec-cfhd-fix-escape-handling-for-old-codebook.patch --]
[-- Type: text/x-patch, Size: 1344 bytes --]

From 64a2e914bb2d0e4833266a51ee2ada3bb8b36e9e Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 3 Sep 2022 11:06:14 +0200
Subject: [PATCH 2/2] avcodec/cfhd: fix escape handling for old codebook

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/cfhd.c     | 2 +-
 libavcodec/cfhddata.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index f908aaf8fb..e72512707e 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -819,7 +819,7 @@ static int cfhd_decode(AVCodecContext *avctx, AVFrame *pic,
                                    VLC_BITS, 3, 1);
 
                         /* escape */
-                        if (level == 64)
+                        if (level == 64 && run == 2)
                             break;
 
                         count += run;
diff --git a/libavcodec/cfhddata.c b/libavcodec/cfhddata.c
index 8079fdf542..67bd8e66db 100644
--- a/libavcodec/cfhddata.c
+++ b/libavcodec/cfhddata.c
@@ -72,7 +72,7 @@ static const uint16_t table_9_vlc_run[NB_VLC_TABLE_9] = {
     1,    1,    1,    1,    1,    1,    1,    1,
     1,    1,    1,    1,    1,    1,    1,    1,
     1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1
+    1,    2,
 };
 
 static const uint8_t table_9_vlc_level[NB_VLC_TABLE_9] = {
-- 
2.37.2


[-- Attachment #4: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2022-09-03 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-03  9:09 [FFmpeg-devel] [PATCH] cfhd decoder fixes for old codebook Paul B Mahol
2022-09-03 11:01 ` Kieran Kunhya

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