forked from FFmpeg/FFmpeg
more #ifdef CONFIG_ENCODERS by (Wolfgang Hesseler <qv at multimediaware dot com>)
Originally committed as revision 1843 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
631670888d
commit
5fd74135ad
3 changed files with 40 additions and 6 deletions
|
@ -67,6 +67,8 @@ void init_put_bits(PutBitContext *s,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENCODERS
|
||||||
|
|
||||||
/* return the number of bits output */
|
/* return the number of bits output */
|
||||||
int64_t get_bit_count(PutBitContext *s)
|
int64_t get_bit_count(PutBitContext *s)
|
||||||
{
|
{
|
||||||
|
@ -86,6 +88,8 @@ void align_put_bits(PutBitContext *s)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif //CONFIG_ENCODERS
|
||||||
|
|
||||||
/* pad the end of the output stream with zeros */
|
/* pad the end of the output stream with zeros */
|
||||||
void flush_put_bits(PutBitContext *s)
|
void flush_put_bits(PutBitContext *s)
|
||||||
{
|
{
|
||||||
|
@ -104,6 +108,8 @@ void flush_put_bits(PutBitContext *s)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENCODERS
|
||||||
|
|
||||||
void put_string(PutBitContext * pbc, char *s)
|
void put_string(PutBitContext * pbc, char *s)
|
||||||
{
|
{
|
||||||
while(*s){
|
while(*s){
|
||||||
|
@ -115,6 +121,8 @@ void put_string(PutBitContext * pbc, char *s)
|
||||||
|
|
||||||
/* bit input functions */
|
/* bit input functions */
|
||||||
|
|
||||||
|
#endif //CONFIG_ENCODERS
|
||||||
|
|
||||||
void init_get_bits(GetBitContext *s,
|
void init_get_bits(GetBitContext *s,
|
||||||
const uint8_t *buffer, int bit_size)
|
const uint8_t *buffer, int bit_size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -170,6 +170,8 @@ static inline void add_median_prediction(uint8_t *dst, uint8_t *src1, uint8_t *d
|
||||||
*left= l;
|
*left= l;
|
||||||
*left_top= lt;
|
*left_top= lt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENCODERS
|
||||||
//FIXME optimize
|
//FIXME optimize
|
||||||
static inline void sub_median_prediction(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){
|
static inline void sub_median_prediction(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){
|
||||||
int i;
|
int i;
|
||||||
|
@ -189,6 +191,7 @@ static inline void sub_median_prediction(uint8_t *dst, uint8_t *src1, uint8_t *s
|
||||||
*left_top= lt;
|
*left_top= lt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif //CONFIG_ENCODERS
|
||||||
|
|
||||||
static inline void add_left_prediction_bgr32(uint8_t *dst, uint8_t *src, int w, int *red, int *green, int *blue){
|
static inline void add_left_prediction_bgr32(uint8_t *dst, uint8_t *src, int w, int *red, int *green, int *blue){
|
||||||
int i;
|
int i;
|
||||||
|
@ -212,6 +215,7 @@ static inline void add_left_prediction_bgr32(uint8_t *dst, uint8_t *src, int w,
|
||||||
*blue= b;
|
*blue= b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENCODERS
|
||||||
static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst, uint8_t *src, int w, int left){
|
static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst, uint8_t *src, int w, int left){
|
||||||
int i;
|
int i;
|
||||||
if(w<32){
|
if(w<32){
|
||||||
|
@ -231,7 +235,7 @@ static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst, uint8_t *src
|
||||||
return src[w-1];
|
return src[w-1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif //CONFIG_ENCODERS
|
||||||
static void read_len_table(uint8_t *dst, GetBitContext *gb){
|
static void read_len_table(uint8_t *dst, GetBitContext *gb){
|
||||||
int i, val, repeat;
|
int i, val, repeat;
|
||||||
|
|
||||||
|
@ -266,6 +270,8 @@ static int generate_bits_table(uint32_t *dst, uint8_t *len_table){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENCODERS
|
||||||
|
|
||||||
static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){
|
static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){
|
||||||
uint64_t counts[2*size];
|
uint64_t counts[2*size];
|
||||||
int up[2*size];
|
int up[2*size];
|
||||||
|
@ -322,6 +328,8 @@ static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif //CONFIG_ENCODERS
|
||||||
|
|
||||||
static int read_huffman_tables(HYuvContext *s, uint8_t *src, int length){
|
static int read_huffman_tables(HYuvContext *s, uint8_t *src, int length){
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
int i;
|
int i;
|
||||||
|
@ -472,6 +480,8 @@ s->bgr32=1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENCODERS
|
||||||
|
|
||||||
static void store_table(HYuvContext *s, uint8_t *len){
|
static void store_table(HYuvContext *s, uint8_t *len){
|
||||||
int i;
|
int i;
|
||||||
int index= s->avctx->extradata_size;
|
int index= s->avctx->extradata_size;
|
||||||
|
@ -585,17 +595,19 @@ static int encode_init(AVCodecContext *avctx)
|
||||||
s->stats[i][j]= 0;
|
s->stats[i][j]= 0;
|
||||||
|
|
||||||
s->interlaced= height > 288;
|
s->interlaced= height > 288;
|
||||||
|
|
||||||
// printf("pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced);
|
// printf("pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced);
|
||||||
|
|
||||||
s->picture_number=0;
|
s->picture_number=0;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif //CONFIG_ENCODERS
|
||||||
|
|
||||||
static void decode_422_bitstream(HYuvContext *s, int count){
|
static void decode_422_bitstream(HYuvContext *s, int count){
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
count/=2;
|
count/=2;
|
||||||
|
|
||||||
for(i=0; i<count; i++){
|
for(i=0; i<count; i++){
|
||||||
|
@ -617,6 +629,8 @@ static void decode_gray_bitstream(HYuvContext *s, int count){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENCODERS
|
||||||
|
|
||||||
static void encode_422_bitstream(HYuvContext *s, int count){
|
static void encode_422_bitstream(HYuvContext *s, int count){
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -655,9 +669,11 @@ static void encode_gray_bitstream(HYuvContext *s, int count){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif //CONFIG_ENCODERS
|
||||||
|
|
||||||
static void decode_bgr_bitstream(HYuvContext *s, int count){
|
static void decode_bgr_bitstream(HYuvContext *s, int count){
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(s->decorrelate){
|
if(s->decorrelate){
|
||||||
if(s->bitstream_bpp==24){
|
if(s->bitstream_bpp==24){
|
||||||
for(i=0; i<count; i++){
|
for(i=0; i<count; i++){
|
||||||
|
@ -965,6 +981,8 @@ static int decode_end(AVCodecContext *avctx)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENCODERS
|
||||||
|
|
||||||
static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
|
static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
|
||||||
HYuvContext *s = avctx->priv_data;
|
HYuvContext *s = avctx->priv_data;
|
||||||
AVFrame *pict = data;
|
AVFrame *pict = data;
|
||||||
|
@ -1126,6 +1144,8 @@ static int encode_end(AVCodecContext *avctx)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif //CONFIG_ENCODERS
|
||||||
|
|
||||||
static const AVOption huffyuv_options[] =
|
static const AVOption huffyuv_options[] =
|
||||||
{
|
{
|
||||||
AVOPTION_CODEC_INT("prediction_method", "prediction_method", prediction_method, 0, 2, 0),
|
AVOPTION_CODEC_INT("prediction_method", "prediction_method", prediction_method, 0, 2, 0),
|
||||||
|
@ -1145,6 +1165,8 @@ AVCodec huffyuv_decoder = {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENCODERS
|
||||||
|
|
||||||
AVCodec huffyuv_encoder = {
|
AVCodec huffyuv_encoder = {
|
||||||
"huffyuv",
|
"huffyuv",
|
||||||
CODEC_TYPE_VIDEO,
|
CODEC_TYPE_VIDEO,
|
||||||
|
@ -1155,3 +1177,5 @@ AVCodec huffyuv_encoder = {
|
||||||
encode_end,
|
encode_end,
|
||||||
.options = huffyuv_options,
|
.options = huffyuv_options,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif //CONFIG_ENCODERS
|
|
@ -1559,8 +1559,10 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
|
||||||
const int dct_algo = avctx->dct_algo;
|
const int dct_algo = avctx->dct_algo;
|
||||||
const int idct_algo= avctx->idct_algo;
|
const int idct_algo= avctx->idct_algo;
|
||||||
|
|
||||||
|
#ifdef CONFIG_ENCODERS
|
||||||
if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX)
|
if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX)
|
||||||
c->fdct = ff_fdct_mmx;
|
c->fdct = ff_fdct_mmx;
|
||||||
|
#endif //CONFIG_ENCODERS
|
||||||
|
|
||||||
if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SIMPLEMMX){
|
if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SIMPLEMMX){
|
||||||
c->idct_put= ff_simple_idct_put_mmx;
|
c->idct_put= ff_simple_idct_put_mmx;
|
||||||
|
|
Loading…
Add table
Reference in a new issue