Commit caa336b4 authored by Michael Niedermayer's avatar Michael Niedermayer

common.c -> bitstream.c (and the single non bitstream func -> utils.c)

common.h -> common.h/bitstream.h

Originally committed as revision 3777 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 61436073
...@@ -9,7 +9,7 @@ VPATH=$(SRC_PATH)/libavcodec ...@@ -9,7 +9,7 @@ VPATH=$(SRC_PATH)/libavcodec
# NOTE: -I.. is needed to include config.h # NOTE: -I.. is needed to include config.h
CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
OBJS= common.o utils.o mem.o allcodecs.o \ OBJS= bitstream.o utils.o mem.o allcodecs.o \
mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\ mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o \ mpegaudio.o ac3enc.o mjpeg.o resample.o resample2.o dsputil.o \
motion_est.o imgconvert.o imgresample.o \ motion_est.o imgconvert.o imgresample.o \
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
//#define DEBUG //#define DEBUG
//#define DEBUG_BITALLOC //#define DEBUG_BITALLOC
#include "avcodec.h" #include "avcodec.h"
#include "bitstream.h"
#include "ac3.h" #include "ac3.h"
typedef struct AC3EncodeContext { typedef struct AC3EncodeContext {
......
...@@ -21,29 +21,12 @@ ...@@ -21,29 +21,12 @@
*/ */
/** /**
* @file common.c * @file bitstream.c
* common internal api. * bitstream api.
*/ */
#include "avcodec.h" #include "avcodec.h"
#include "bitstream.h"
const uint8_t ff_sqrt_tab[128]={
0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11
};
const uint8_t ff_log2_tab[256]={
0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
};
void align_put_bits(PutBitContext *s) void align_put_bits(PutBitContext *s)
{ {
...@@ -302,7 +285,3 @@ void free_vlc(VLC *vlc) ...@@ -302,7 +285,3 @@ void free_vlc(VLC *vlc)
av_free(vlc->table); av_free(vlc->table);
} }
int64_t ff_gcd(int64_t a, int64_t b){
if(b) return ff_gcd(b, a%b);
else return a;
}
This diff is collapsed.
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <string.h> #include <string.h>
#include "common.h" #include "common.h"
#include "bitstream.h"
#include "cabac.h" #include "cabac.h"
const uint8_t ff_h264_lps_range[64][4]= { const uint8_t ff_h264_lps_range[64][4]= {
......
This diff is collapsed.
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
*/ */
#include "common.h" #include "common.h"
#include "bitstream.h"
#include "avcodec.h" #include "avcodec.h"
#include "dsputil.h" #include "dsputil.h"
#include "rangecoder.h" #include "rangecoder.h"
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <limits.h> #include <limits.h>
#include "avcodec.h" #include "avcodec.h"
#include "bitstream.h"
#include "golomb.h" #include "golomb.h"
#undef NDEBUG #undef NDEBUG
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <limits.h> #include <limits.h>
#include "avcodec.h" #include "avcodec.h"
#include "common.h" #include "common.h"
#include "bitstream.h"
/** /**
* G.726 11bit float. * G.726 11bit float.
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
*/ */
#include "common.h" #include "common.h"
#include "bitstream.h"
#include "avcodec.h" #include "avcodec.h"
#include "dsputil.h" #include "dsputil.h"
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "common.h" #include "common.h"
#include "bitstream.h"
#include "avcodec.h" #include "avcodec.h"
#ifdef CONFIG_ZLIB #ifdef CONFIG_ZLIB
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*/ */
#include "avcodec.h" #include "avcodec.h"
#include "bitstream.h"
#include "mpegaudio.h" #include "mpegaudio.h"
/* currently, cannot change these constants (need to modify /* currently, cannot change these constants (need to modify
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
//#define DEBUG //#define DEBUG
#include "avcodec.h" #include "avcodec.h"
#include "bitstream.h"
#include "mpegaudio.h" #include "mpegaudio.h"
#include "dsputil.h" #include "dsputil.h"
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define AVCODEC_MPEGVIDEO_H #define AVCODEC_MPEGVIDEO_H
#include "dsputil.h" #include "dsputil.h"
#include "bitstream.h"
#define FRAME_SKIPED 100 ///< return value for header parsers if frame is not coded #define FRAME_SKIPED 100 ///< return value for header parsers if frame is not coded
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "avcodec.h" #include "avcodec.h"
#include "bitstream.h"
#include "golomb.h" #include "golomb.h"
/** /**
......
...@@ -31,6 +31,24 @@ ...@@ -31,6 +31,24 @@
#include <stdarg.h> #include <stdarg.h>
#include <limits.h> #include <limits.h>
const uint8_t ff_sqrt_tab[128]={
0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11
};
const uint8_t ff_log2_tab[256]={
0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
};
void avcodec_default_free_buffers(AVCodecContext *s); void avcodec_default_free_buffers(AVCodecContext *s);
void *av_mallocz(unsigned int size) void *av_mallocz(unsigned int size)
...@@ -881,6 +899,11 @@ int64_t av_rescale(int64_t a, int64_t b, int64_t c){ ...@@ -881,6 +899,11 @@ int64_t av_rescale(int64_t a, int64_t b, int64_t c){
return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF);
} }
int64_t ff_gcd(int64_t a, int64_t b){
if(b) return ff_gcd(b, a%b);
else return a;
}
/* av_log API */ /* av_log API */
static int av_log_level = AV_LOG_DEBUG; static int av_log_level = AV_LOG_DEBUG;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
*/ */
#include "avcodec.h" #include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h" #include "dsputil.h"
/* size of blocks */ /* size of blocks */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment