Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 6/7] avcodec/internal: Move FF_SIGNBIT and ff_log2_run to mathops.h
Date: Thu, 17 Mar 2022 13:43:18 +0100
Message-ID: <AS1PR01MB9564E69EF54959E3254B3A348F129@AS1PR01MB9564.eurprd01.prod.exchangelabs.com> (raw)
In-Reply-To: <AS1PR01MB9564621E92A6F42E563B74A38F119@AS1PR01MB9564.eurprd01.prod.exchangelabs.com>

It is a more fitting place for them.
Also move the definition of ff_log2_run to mathtables.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/aptx.c       | 2 +-
 libavcodec/bitstream.c  | 9 ---------
 libavcodec/cavs.c       | 4 ----
 libavcodec/cavsdec.c    | 1 +
 libavcodec/dnxhdenc.c   | 2 +-
 libavcodec/ffv1dec.c    | 1 -
 libavcodec/ffv1enc.c    | 1 -
 libavcodec/internal.h   | 4 ----
 libavcodec/jpeglsdec.c  | 2 --
 libavcodec/jpeglsenc.c  | 1 -
 libavcodec/mathops.h    | 3 +++
 libavcodec/mathtables.c | 9 +++++++++
 12 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/libavcodec/aptx.c b/libavcodec/aptx.c
index b1a78c5f77..f2604be60c 100644
--- a/libavcodec/aptx.c
+++ b/libavcodec/aptx.c
@@ -21,7 +21,7 @@
  */
 
 #include "aptx.h"
-#include "internal.h"
+#include "mathops.h"
 
 
 static const int32_t quantize_intervals_LF[65] = {
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 36a980646d..3606575055 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -36,15 +36,6 @@
 #include "libavutil/intreadwrite.h"
 #include "put_bits.h"
 
-const uint8_t ff_log2_run[41]={
- 0, 0, 0, 0, 1, 1, 1, 1,
- 2, 2, 2, 2, 3, 3, 3, 3,
- 4, 4, 5, 5, 6, 6, 7, 7,
- 8, 9,10,11,12,13,14,15,
-16,17,18,19,20,21,22,23,
-24,
-};
-
 void ff_put_string(PutBitContext *pb, const char *string, int terminate_string)
 {
     while (*string) {
diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c
index 5367c44248..87bbe26f98 100644
--- a/libavcodec/cavs.c
+++ b/libavcodec/cavs.c
@@ -25,14 +25,10 @@
  * @author Stefan Gehrer <stefan.gehrer@gmx.de>
  */
 
-#include "libavutil/mem_internal.h"
-
 #include "avcodec.h"
-#include "get_bits.h"
 #include "golomb.h"
 #include "h264chroma.h"
 #include "idctdsp.h"
-#include "internal.h"
 #include "mathops.h"
 #include "qpeldsp.h"
 #include "cavs.h"
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index ba7ead6f41..760dd792cb 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -32,6 +32,7 @@
 #include "cavs.h"
 #include "codec_internal.h"
 #include "internal.h"
+#include "mathops.h"
 #include "mpeg12data.h"
 #include "startcode.h"
 
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 6d4d7e01c7..1795993efe 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -33,7 +33,7 @@
 #include "codec_internal.h"
 #include "encode.h"
 #include "fdctdsp.h"
-#include "internal.h"
+#include "mathops.h"
 #include "mpegvideo.h"
 #include "mpegvideoenc.h"
 #include "pixblockdsp.h"
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index a5aae79c94..d1f69ae6e1 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -32,7 +32,6 @@
 #include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "codec_internal.h"
-#include "internal.h"
 #include "get_bits.h"
 #include "rangecoder.h"
 #include "golomb.h"
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index edaa8b4b3d..13af2547a0 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -35,7 +35,6 @@
 #include "avcodec.h"
 #include "encode.h"
 #include "codec_internal.h"
-#include "internal.h"
 #include "put_bits.h"
 #include "put_golomb.h"
 #include "rangecoder.h"
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 854c969395..351c057d01 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -44,8 +44,6 @@
 
 #define FF_SANE_NB_CHANNELS 512U
 
-#define FF_SIGNBIT(x) ((x) >> CHAR_BIT * sizeof(x) - 1)
-
 #if HAVE_SIMD_ALIGN_64
 #   define STRIDE_ALIGN 64 /* AVX-512 */
 #elif HAVE_SIMD_ALIGN_32
@@ -159,8 +157,6 @@ typedef struct AVCodecInternal {
     AVChannelLayout initial_ch_layout;
 } AVCodecInternal;
 
-extern const uint8_t ff_log2_run[41];
-
 /**
  * Return the index into tab at which {a,b} match elements {[0],[1]} of tab.
  * If there is no such matching pair then size is returned.
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index c3d0a1c9a7..4c747b3919 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -29,9 +29,7 @@
 #include "codec_internal.h"
 #include "get_bits.h"
 #include "golomb.h"
-#include "internal.h"
 #include "mathops.h"
-#include "mjpeg.h"
 #include "mjpegdec.h"
 #include "jpegls.h"
 #include "jpeglsdec.h"
diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c
index 42c2d6b038..dbd7941df2 100644
--- a/libavcodec/jpeglsenc.c
+++ b/libavcodec/jpeglsenc.c
@@ -34,7 +34,6 @@
 #include "get_bits.h"
 #include "put_bits.h"
 #include "put_golomb.h"
-#include "internal.h"
 #include "mathops.h"
 #include "mjpeg.h"
 #include "jpegls.h"
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 239e0e492f..f81d21f9c4 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -30,6 +30,7 @@
 #define MAX_NEG_CROP 1024
 
 extern const uint32_t ff_inverse[257];
+extern const uint8_t ff_log2_run[41];
 extern const uint8_t ff_sqrt_tab[256];
 extern const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP];
 extern const uint8_t ff_zigzag_direct[64];
@@ -125,6 +126,8 @@ static inline av_const int median4(int a, int b, int c, int d)
 }
 #endif
 
+#define FF_SIGNBIT(x) ((x) >> CHAR_BIT * sizeof(x) - 1)
+
 #ifndef sign_extend
 static inline av_const int sign_extend(int val, unsigned bits)
 {
diff --git a/libavcodec/mathtables.c b/libavcodec/mathtables.c
index 81eabc7a65..8b0031eb00 100644
--- a/libavcodec/mathtables.c
+++ b/libavcodec/mathtables.c
@@ -112,3 +112,12 @@ const uint8_t ff_zigzag_scan[16+1] = {
     1 + 2 * 4, 0 + 3 * 4, 1 + 3 * 4, 2 + 2 * 4,
     3 + 1 * 4, 3 + 2 * 4, 2 + 3 * 4, 3 + 3 * 4,
 };
+
+const uint8_t ff_log2_run[41] = {
+ 0,  0,  0,  0,  1,  1,  1,  1,
+ 2,  2,  2,  2,  3,  3,  3,  3,
+ 4,  4,  5,  5,  6,  6,  7,  7,
+ 8,  9, 10, 11, 12, 13, 14, 15,
+16, 17, 18, 19, 20, 21, 22, 23,
+24,
+};
-- 
2.32.0

_______________________________________________
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".

  parent reply	other threads:[~2022-03-17 12:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 21:45 [FFmpeg-devel] [PATCH 1/3] avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.h Andreas Rheinhardt
2022-03-16 21:47 ` [FFmpeg-devel] [PATCH 2/3] avcodec/codec_internal: Add FFCodec, hide internal part of AVCodec Andreas Rheinhardt
2022-03-16 21:47 ` [FFmpeg-devel] [PATCH 3/3] avcodec/codec_internal: Rename AVCodecDefault->FFCodecDefault Andreas Rheinhardt
2022-03-17 12:43 ` [FFmpeg-devel] [PATCH 4/7] avcodec/mathops: Move bitswap_32() to its only user Andreas Rheinhardt
2022-03-17 12:43 ` [FFmpeg-devel] [PATCH 5/7] avcodec/bitstream: Move code for initializing VLCs to file of its own Andreas Rheinhardt
2022-03-17 12:43 ` Andreas Rheinhardt [this message]
2022-03-17 12:43 ` [FFmpeg-devel] [PATCH 7/7] avcodec/internal: Move FF_DEFAULT_QUANT_BIAS to mpegvideoenc.h Andreas Rheinhardt
2022-03-18 10:52 ` [FFmpeg-devel] [PATCH 8/8] avcodec/codec_internal: Include codec_tags only when they are needed Andreas Rheinhardt
2022-03-18 13:13   ` Michael Niedermayer
2022-03-18 13:31     ` Michael Niedermayer
2022-03-18 13:39       ` Andreas Rheinhardt
2022-03-18 13:37     ` Andreas Rheinhardt
2022-03-31  8:26   ` Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS1PR01MB9564E69EF54959E3254B3A348F129@AS1PR01MB9564.eurprd01.prod.exchangelabs.com \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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