else return code - 3;
}
-#ifdef CONFIG_ENCODERS
-
static inline void put_level(PutBitContext *pb, int level){
unsigned int index= level + 3;
}
}
-#endif //CONFIG_ENCODERS
-
static inline int decode_block(ASV1Context *a, DCTELEM block[64]){
int i;
return 0;
}
-#ifdef CONFIG_ENCODERS
-
static inline void encode_block(ASV1Context *a, DCTELEM block[64]){
int i;
int nc_count=0;
put_bits(&a->pb, ccp_tab[16][1], ccp_tab[16][0]);
}
-#endif //CONFIG_ENCODERS
-
static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64]){
int i;
return 0;
}
-#ifdef CONFIG_ENCODERS
-
static inline void encode_mb(ASV1Context *a, DCTELEM block[6][64]){
int i;
encode_block(a, block[i]);
}
}
-
-#endif //CONFIG_ENCODERS
static inline void idct_put(ASV1Context *a, int mb_x, int mb_y){
DCTELEM (*block)[64]= a->block;
}
}
-#ifdef CONFIG_ENCODERS
-
static inline void dct_get(ASV1Context *a, int mb_x, int mb_y){
DCTELEM (*block)[64]= a->block;
int linesize= a->picture.linesize[0];
}
}
-#endif //CONFIG_ENCODERS
-
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
return (get_bits_count(&a->gb)+31)/32*4;
}
-#ifdef CONFIG_ENCODERS
-
static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
ASV1Context * const a = avctx->priv_data;
AVFrame *pict = data;
return size*4;
}
-#endif //CONFIG_ENCODERS
-
static void common_init(AVCodecContext *avctx){
ASV1Context * const a = avctx->priv_data;
return 0;
}
-#ifdef CONFIG_ENCODERS
-
static int encode_init(AVCodecContext *avctx){
ASV1Context * const a = avctx->priv_data;
int i;
return 0;
}
-#endif //CONFIG_ENCODERS
-
static int decode_end(AVCodecContext *avctx){
ASV1Context * const a = avctx->priv_data;
NULL
};
+#ifdef CONFIG_ENCODERS
AVCodec ffv1_encoder = {
"ffv1",
CODEC_TYPE_VIDEO,
encode_frame,
encode_end,
};
+#endif
*left_top= lt;
}
-#ifdef CONFIG_ENCODERS
//FIXME optimize
static inline void sub_median_prediction(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){
int i;
*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){
int i;
int r,g,b;
*blue= b;
}
-#ifdef CONFIG_ENCODERS
static inline int sub_left_prediction(HYuvContext *s, uint8_t *dst, uint8_t *src, int w, int left){
int i;
if(w<32){
return src[w-1];
}
}
-#endif //CONFIG_ENCODERS
+
static void read_len_table(uint8_t *dst, GetBitContext *gb){
int i, val, repeat;
return 0;
}
-#ifdef CONFIG_ENCODERS
-
static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){
uint64_t counts[2*size];
int up[2*size];
}
}
-#endif //CONFIG_ENCODERS
-
static int read_huffman_tables(HYuvContext *s, uint8_t *src, int length){
GetBitContext gb;
int i;
return 0;
}
-#ifdef CONFIG_ENCODERS
-
static void store_table(HYuvContext *s, uint8_t *len){
int i;
int index= s->avctx->extradata_size;
return 0;
}
-#endif //CONFIG_ENCODERS
-
static void decode_422_bitstream(HYuvContext *s, int count){
int i;
}
}
-#ifdef CONFIG_ENCODERS
-
static void encode_422_bitstream(HYuvContext *s, int count){
int i;
}
}
-#endif //CONFIG_ENCODERS
-
static void decode_bgr_bitstream(HYuvContext *s, int count){
int i;
return 0;
}
-#ifdef CONFIG_ENCODERS
-
static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
HYuvContext *s = avctx->priv_data;
AVFrame *pict = data;
AVOPTION_END()
};
-#endif //CONFIG_ENCODERS
-
AVCodec huffyuv_decoder = {
"huffyuv",
CODEC_TYPE_VIDEO,
case 7: ret= (left + top)>>1; break;\
}
+#ifdef CONFIG_ENCODERS
static inline void put_marker(PutBitContext *p, int code)
{
put_bits(p, 8, 0xff);
mant--;
}
- nbits= av_log2(val) + 1;
+ nbits= av_log2_16bit(val) + 1;
put_bits(&s->pb, huff_size[nbits], huff_code[nbits]);
// return (get_bit_count(&f->pb)+7)/8;
}
+#endif //CONFIG_ENCODERS
/******************************************/
/* decoding */
NULL
};
+#ifdef CONFIG_ENCODERS
AVCodec ljpeg_encoder = { //FIXME avoid MPV_* lossless jpeg shouldnt need them
"ljpeg",
CODEC_TYPE_VIDEO,
encode_picture_lossless,
MPV_encode_end,
};
+#endif
static uint32_t uni_mpeg1_ac_vlc_bits[64*64*2];
static uint8_t uni_mpeg1_ac_vlc_len [64*64*2];
+
+/* simple include everything table for dc, first byte is bits number next 3 are code*/
+static uint32_t mpeg1_lum_dc_uni[512];
+static uint32_t mpeg1_chr_dc_uni[512];
+
+static uint8_t mpeg1_index_run[2][64];
+static int8_t mpeg1_max_level[2][64];
#endif
static void init_2d_vlc_rl(RLTable *rl)
}
}
+#ifdef CONFIG_ENCODERS
static void init_uni_ac_vlc(RLTable *rl, uint32_t *uni_ac_vlc_bits, uint8_t *uni_ac_vlc_len){
int i;
put_bits(&s->pb, 1, 1);
put_bits(&s->pb, 1, 1);
}
+#endif
static void common_init(MpegEncContext *s)
{
s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
}
+void ff_mpeg1_clean_buffers(MpegEncContext *s){
+ s->last_dc[0] = 1 << (7 + s->intra_dc_precision);
+ s->last_dc[1] = s->last_dc[0];
+ s->last_dc[2] = s->last_dc[0];
+ memset(s->last_mv, 0, sizeof(s->last_mv));
+}
+
#ifdef CONFIG_ENCODERS
void ff_mpeg1_encode_slice_header(MpegEncContext *s){
put_bits(&s->pb, 1, 0); /* slice extra information */
}
-void ff_mpeg1_clean_buffers(MpegEncContext *s){
- s->last_dc[0] = 1 << (7 + s->intra_dc_precision);
- s->last_dc[1] = s->last_dc[0];
- s->last_dc[2] = s->last_dc[0];
- memset(s->last_mv, 0, sizeof(s->last_mv));
-}
-
void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
{
mpeg1_encode_sequence_header(s);
16, 16, 16, 16, 16, 16, 16, 16,
};
-const unsigned char vlc_dc_table[256] = {
+static const unsigned char vlc_dc_table[256] = {
0, 1, 2, 2,
3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
};
-const uint16_t vlc_dc_lum_code[12] = {
+static const uint16_t vlc_dc_lum_code[12] = {
0x4, 0x0, 0x1, 0x5, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x1ff,
};
-const unsigned char vlc_dc_lum_bits[12] = {
+static const unsigned char vlc_dc_lum_bits[12] = {
3, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 9,
};
2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10,
};
-/* simple include everything table for dc, first byte is bits number next 3 are code*/
-static uint32_t mpeg1_lum_dc_uni[512];
-static uint32_t mpeg1_chr_dc_uni[512];
-
static const uint16_t mpeg1_vlc[113][2] = {
{ 0x3, 2 }, { 0x4, 4 }, { 0x5, 5 }, { 0x6, 7 },
{ 0x26, 8 }, { 0x21, 8 }, { 0xa, 10 }, { 0x1d, 12 },
25, 26, 27, 28, 29, 30, 31,
};
-static uint8_t mpeg1_index_run[2][64];
-static int8_t mpeg1_max_level[2][64];
-
static RLTable rl_mpeg1 = {
111,
111,
static uint32_t v2_dc_lum_table[512][2];
static uint32_t v2_dc_chroma_table[512][2];
-#ifdef CONFIG_ENCODERS
static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n);
-#endif //CONFIG_ENCODERS
static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
int n, int coded, const uint8_t *scantable);
static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
static int msmpeg4_decode_motion(MpegEncContext * s,
int *mx_ptr, int *my_ptr);
-#ifdef CONFIG_ENCODERS
static void msmpeg4v2_encode_motion(MpegEncContext * s, int val);
-#endif //CONFIG_ENCODERS
static void init_h263_dc_for_msmpeg4(void);
static inline void msmpeg4_memsetw(short *tab, int val, int n);
#ifdef CONFIG_ENCODERS
#include "msmpeg4data.h"
+#ifdef CONFIG_ENCODERS //strangely gcc includes this even if its not references
static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2];
+#endif //CONFIG_ENCODERS
#ifdef STATS
#define DC_MAX 119
-#ifdef CONFIG_ENCODERS
-
static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr)
{
int sign, code;
}
}
-#endif //CONFIG_ENCODERS
-
/****************************************/
/* decoding stuff */
tab[i] = val;
}
-#ifdef CONFIG_ENCODERS
-
static void msmpeg4v2_encode_motion(MpegEncContext * s, int val)
{
int range, bit_size, sign, code, bits;
}
}
-#endif //CONFIG_ENCODERS
-
/* this is identical to h263 except that its range is multiplied by 2 */
static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code)
{