avcodec/internal: Move FF_SIGNBIT and ff_log2_run to mathops.h

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>
release/5.1
Andreas Rheinhardt 3 years ago
parent 495de744fa
commit 86c909558c
  1. 2
      libavcodec/aptx.c
  2. 9
      libavcodec/bitstream.c
  3. 4
      libavcodec/cavs.c
  4. 1
      libavcodec/cavsdec.c
  5. 2
      libavcodec/dnxhdenc.c
  6. 1
      libavcodec/ffv1dec.c
  7. 1
      libavcodec/ffv1enc.c
  8. 4
      libavcodec/internal.h
  9. 2
      libavcodec/jpeglsdec.c
  10. 1
      libavcodec/jpeglsenc.c
  11. 3
      libavcodec/mathops.h
  12. 9
      libavcodec/mathtables.c

@ -21,7 +21,7 @@
*/ */
#include "aptx.h" #include "aptx.h"
#include "internal.h" #include "mathops.h"
static const int32_t quantize_intervals_LF[65] = { static const int32_t quantize_intervals_LF[65] = {

@ -36,15 +36,6 @@
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "put_bits.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) void ff_put_string(PutBitContext *pb, const char *string, int terminate_string)
{ {
while (*string) { while (*string) {

@ -25,14 +25,10 @@
* @author Stefan Gehrer <stefan.gehrer@gmx.de> * @author Stefan Gehrer <stefan.gehrer@gmx.de>
*/ */
#include "libavutil/mem_internal.h"
#include "avcodec.h" #include "avcodec.h"
#include "get_bits.h"
#include "golomb.h" #include "golomb.h"
#include "h264chroma.h" #include "h264chroma.h"
#include "idctdsp.h" #include "idctdsp.h"
#include "internal.h"
#include "mathops.h" #include "mathops.h"
#include "qpeldsp.h" #include "qpeldsp.h"
#include "cavs.h" #include "cavs.h"

@ -32,6 +32,7 @@
#include "cavs.h" #include "cavs.h"
#include "codec_internal.h" #include "codec_internal.h"
#include "internal.h" #include "internal.h"
#include "mathops.h"
#include "mpeg12data.h" #include "mpeg12data.h"
#include "startcode.h" #include "startcode.h"

@ -33,7 +33,7 @@
#include "codec_internal.h" #include "codec_internal.h"
#include "encode.h" #include "encode.h"
#include "fdctdsp.h" #include "fdctdsp.h"
#include "internal.h" #include "mathops.h"
#include "mpegvideo.h" #include "mpegvideo.h"
#include "mpegvideoenc.h" #include "mpegvideoenc.h"
#include "pixblockdsp.h" #include "pixblockdsp.h"

@ -32,7 +32,6 @@
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
#include "avcodec.h" #include "avcodec.h"
#include "codec_internal.h" #include "codec_internal.h"
#include "internal.h"
#include "get_bits.h" #include "get_bits.h"
#include "rangecoder.h" #include "rangecoder.h"
#include "golomb.h" #include "golomb.h"

@ -35,7 +35,6 @@
#include "avcodec.h" #include "avcodec.h"
#include "encode.h" #include "encode.h"
#include "codec_internal.h" #include "codec_internal.h"
#include "internal.h"
#include "put_bits.h" #include "put_bits.h"
#include "put_golomb.h" #include "put_golomb.h"
#include "rangecoder.h" #include "rangecoder.h"

@ -44,8 +44,6 @@
#define FF_SANE_NB_CHANNELS 512U #define FF_SANE_NB_CHANNELS 512U
#define FF_SIGNBIT(x) ((x) >> CHAR_BIT * sizeof(x) - 1)
#if HAVE_SIMD_ALIGN_64 #if HAVE_SIMD_ALIGN_64
# define STRIDE_ALIGN 64 /* AVX-512 */ # define STRIDE_ALIGN 64 /* AVX-512 */
#elif HAVE_SIMD_ALIGN_32 #elif HAVE_SIMD_ALIGN_32
@ -159,8 +157,6 @@ typedef struct AVCodecInternal {
AVChannelLayout initial_ch_layout; AVChannelLayout initial_ch_layout;
} AVCodecInternal; } AVCodecInternal;
extern const uint8_t ff_log2_run[41];
/** /**
* Return the index into tab at which {a,b} match elements {[0],[1]} of tab. * 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. * If there is no such matching pair then size is returned.

@ -29,9 +29,7 @@
#include "codec_internal.h" #include "codec_internal.h"
#include "get_bits.h" #include "get_bits.h"
#include "golomb.h" #include "golomb.h"
#include "internal.h"
#include "mathops.h" #include "mathops.h"
#include "mjpeg.h"
#include "mjpegdec.h" #include "mjpegdec.h"
#include "jpegls.h" #include "jpegls.h"
#include "jpeglsdec.h" #include "jpeglsdec.h"

@ -34,7 +34,6 @@
#include "get_bits.h" #include "get_bits.h"
#include "put_bits.h" #include "put_bits.h"
#include "put_golomb.h" #include "put_golomb.h"
#include "internal.h"
#include "mathops.h" #include "mathops.h"
#include "mjpeg.h" #include "mjpeg.h"
#include "jpegls.h" #include "jpegls.h"

@ -30,6 +30,7 @@
#define MAX_NEG_CROP 1024 #define MAX_NEG_CROP 1024
extern const uint32_t ff_inverse[257]; 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_sqrt_tab[256];
extern const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP]; extern const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP];
extern const uint8_t ff_zigzag_direct[64]; 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 #endif
#define FF_SIGNBIT(x) ((x) >> CHAR_BIT * sizeof(x) - 1)
#ifndef sign_extend #ifndef sign_extend
static inline av_const int sign_extend(int val, unsigned bits) static inline av_const int sign_extend(int val, unsigned bits)
{ {

@ -112,3 +112,12 @@ const uint8_t ff_zigzag_scan[16+1] = {
1 + 2 * 4, 0 + 3 * 4, 1 + 3 * 4, 2 + 2 * 4, 1 + 2 * 4, 0 + 3 * 4, 1 + 3 * 4, 2 + 2 * 4,
3 + 1 * 4, 3 + 2 * 4, 2 + 3 * 4, 3 + 3 * 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,
};

Loading…
Cancel
Save