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 1/9] avcodec/dvdata: Order code table by codes
@ 2022-09-04 21:54 Andreas Rheinhardt
  2022-09-04 21:58 ` [FFmpeg-devel] [PATCH 2/9] avcodec/dvdec: Use ff_init_vlc_from_lengths() Andreas Rheinhardt
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Andreas Rheinhardt @ 2022-09-04 21:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Right now, it is nearly ordered by "left codes in the tree first";
the only exception is the escape value which has been put at the
end. This commit moves it to the place it should have according
to the above order. This is in preparation for further commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/dv_tablegen.h |  2 +-
 libavcodec/dvdata.c      | 12 ++++--------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/libavcodec/dv_tablegen.h b/libavcodec/dv_tablegen.h
index 941b5572be..0dcfffc140 100644
--- a/libavcodec/dv_tablegen.h
+++ b/libavcodec/dv_tablegen.h
@@ -51,7 +51,7 @@ static struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE];
 static av_cold void dv_vlc_map_tableinit(void)
 {
     int i, j;
-    for (i = 0; i < NB_DV_VLC - 1; i++) {
+    for (int i = 0; i < NB_DV_VLC; i++) {
         if (ff_dv_vlc_run[i] >= DV_VLC_MAP_RUN_SIZE)
             continue;
 #if CONFIG_SMALL
diff --git a/libavcodec/dvdata.c b/libavcodec/dvdata.c
index 231569a328..1e48db591d 100644
--- a/libavcodec/dvdata.c
+++ b/libavcodec/dvdata.c
@@ -75,7 +75,7 @@ const uint8_t ff_dv_quant_offset[4] = { 6, 3, 0, 1 };
  * when building misc. tables. E.g. (1, 0) can be either 0x7cf or 0x1f82.
  */
 const uint16_t ff_dv_vlc_bits[NB_DV_VLC] = {
-    0x0000, 0x0002, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016,
+    0x0000, 0x0002, 0x0006, 0x0007, 0x0008, 0x0009, 0x0014, 0x0015, 0x0016,
     0x0017, 0x0030, 0x0031, 0x0032, 0x0033, 0x0068, 0x0069, 0x006a,
     0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x00e0, 0x00e1, 0x00e2,
     0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea,
@@ -126,11 +126,10 @@ const uint16_t ff_dv_vlc_bits[NB_DV_VLC] = {
     0x7fe8, 0x7fe9, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fee, 0x7fef,
     0x7ff0, 0x7ff1, 0x7ff2, 0x7ff3, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7,
     0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff,
-    0x0006,
 };
 
 const uint8_t ff_dv_vlc_len[NB_DV_VLC] = {
-     2,  3,  4,  4,  4,  5,  5,  5,
+     2,  3,  4,  4,  4,  4,  5,  5,  5,
      5,  6,  6,  6,  6,  7,  7,  7,
      7,  7,  7,  7,  7,  8,  8,  8,
      8,  8,  8,  8,  8,  8,  8,  8,
@@ -181,11 +180,10 @@ const uint8_t ff_dv_vlc_len[NB_DV_VLC] = {
     15, 15, 15, 15, 15, 15, 15, 15,
     15, 15, 15, 15, 15, 15, 15, 15,
     15, 15, 15, 15, 15, 15, 15, 15,
-     4,
 };
 
 const uint8_t ff_dv_vlc_run[NB_DV_VLC] = {
-     0,  0,  1,  0,  0,  2,  1,  0,
+     0,  0, 127, 1,  0,  0,  2,  1,  0,
      0,  3,  4,  0,  0,  5,  6,  2,
      1,  1,  0,  0,  0,  7,  8,  9,
     10,  3,  4,  2,  1,  1,  1,  0,
@@ -236,11 +234,10 @@ const uint8_t ff_dv_vlc_run[NB_DV_VLC] = {
      0,  0,  0,  0,  0,  0,  0,  0,
      0,  0,  0,  0,  0,  0,  0,  0,
      0,  0,  0,  0,  0,  0,  0,  0,
-   127,
 };
 
 const uint8_t ff_dv_vlc_level[NB_DV_VLC] = {
-     1,   2,   1,   3,   4,   1,   2,   5,
+     1,   2,   0,   1,   3,   4,   1,   2,   5,
      6,   1,   1,   7,   8,   1,   1,   2,
      3,   4,   9,  10,  11,   1,   1,   1,
      1,   2,   2,   3,   5,   6,   7,  12,
@@ -291,5 +288,4 @@ const uint8_t ff_dv_vlc_level[NB_DV_VLC] = {
    232, 233, 234, 235, 236, 237, 238, 239,
    240, 241, 242, 243, 244, 245, 246, 247,
    248, 249, 250, 251, 252, 253, 254, 255,
-     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] 10+ messages in thread

end of thread, other threads:[~2022-09-06  1:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-04 21:54 [FFmpeg-devel] [PATCH 1/9] avcodec/dvdata: Order code table by codes Andreas Rheinhardt
2022-09-04 21:58 ` [FFmpeg-devel] [PATCH 2/9] avcodec/dvdec: Use ff_init_vlc_from_lengths() Andreas Rheinhardt
2022-09-04 21:58 ` [FFmpeg-devel] [PATCH 3/9] avcodec/dv_tablegen, dvdata: Remove ff_dv_vlc_bits Andreas Rheinhardt
2022-09-04 21:58 ` [FFmpeg-devel] [PATCH 4/9] avcodec/dvdec: Mark dv_init_static() as av_cold Andreas Rheinhardt
2022-09-04 21:58 ` [FFmpeg-devel] [PATCH 5/9] avcodec/dvdec: Avoid stack buffers Andreas Rheinhardt
2022-09-04 21:58 ` [FFmpeg-devel] [PATCH 6/9] avcodec/wmavoice: Avoid code table Andreas Rheinhardt
2022-09-04 21:58 ` [FFmpeg-devel] [PATCH 7/9] avcodec/wmaprodec: Use ff_init_vlc_from_lengths() instead of init_vlc Andreas Rheinhardt
2022-09-04 21:58 ` [FFmpeg-devel] [PATCH 8/9] avcodec/wmaprodec: Move applying offset to VLC creation Andreas Rheinhardt
2022-09-04 21:58 ` [FFmpeg-devel] [PATCH 9/9] avcodec/wmaprodec: Use symbol table more efficiently Andreas Rheinhardt
2022-09-06  1:33 ` [FFmpeg-devel] [PATCH 1/9] avcodec/dvdata: Order code table by codes 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