static void opt_target(const char *arg)
{
int norm = -1;
- static const char const *frame_rates[] = {"25", "30000/1001", "24000/1001"};
+ static const char *const frame_rates[] = {"25", "30000/1001", "24000/1001"};
if(!strncmp(arg, "pal-", 4)) {
norm = 0;
return 0;
}
+#if 0
static void dump(unsigned char *buf,size_t len)
{
int i;
}
av_log(NULL, AV_LOG_ERROR, "\n");
}
+#endif
+
static int adx_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf0, int buf_size)
void avcodec_flush_buffers(AVCodecContext *avctx);
+void avcodec_default_free_buffers(AVCodecContext *s);
+
/* misc usefull functions */
/**
c->bytestream+= CABAC_BITS/8;
}
+#if 0 /* all use commented */
static void refill2(CABACContext *c){
int i, x;
c->low += x<<i;
c->bytestream+= CABAC_BITS/8;
}
-
+#endif
static inline void renorm_cabac_decoder(CABACContext *c){
while(c->range < (0x200 << CABAC_BITS)){
static inline int get_cabac(CABACContext *c, uint8_t * const state){
int RangeLPS= c->lps_range[*state][c->range>>(CABAC_BITS+7)]<<(CABAC_BITS+1);
- int bit, lps_mask;
+ int bit, lps_mask attribute_unused;
c->range -= RangeLPS;
#if 1
return 0;
}
+#if 0
static int encode_init(AVCodecContext *avctx){
common_init(avctx);
return 0;
}
+#endif
AVCodec cljr_decoder = {
"cljr",
#endif
#endif
+#ifndef attribute_unused
+#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
+# define attribute_unused __attribute__((unused))
+#else
+# define attribute_unused
+#endif
+#endif
+
#ifndef EMULATE_INTTYPES
# include <inttypes.h>
#else
#include "simple_idct.h"
#include "faandct.h"
+/* snow.c */
+void ff_spatial_dwt(int *buffer, int width, int height, int stride, int type, int decomposition_count);
+
uint8_t cropTbl[256 + 2 * MAX_NEG_CROP] = {0, };
uint32_t squareTbl[512] = {0, };
#define op_scale2(x) dst[x] = clip_uint8( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1))
#define H264_WEIGHT(W,H) \
static void weight_h264_pixels ## W ## x ## H ## _c(uint8_t *block, int stride, int log2_denom, int weight, int offset){ \
- int x, y; \
+ int attribute_unused x, y; \
offset <<= log2_denom; \
if(log2_denom) offset += 1<<(log2_denom-1); \
for(y=0; y<H; y++, block += stride){ \
} \
} \
static void biweight_h264_pixels ## W ## x ## H ## _c(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offsetd, int offsets){ \
- int x, y; \
+ int attribute_unused x, y; \
int offset = (offsets + offsetd + 1) >> 1; \
offset = ((offset << 1) + 1) << log2_denom; \
for(y=0; y<H; y++, dst += stride, src += stride){ \
faacDecFrameInfo *hInfo,
unsigned char *buffer,
unsigned long buffer_size);
- unsigned char* FAADAPI (*faacDecGetErrorMessage)(unsigned char errcode);
+ char* FAADAPI (*faacDecGetErrorMessage)(unsigned char errcode);
#endif
void FAADAPI (*faacDecClose)(faacDecHandle hDecoder);
return r;
}
-static int faac_init_aac(AVCodecContext *avctx)
-{
- return 0;
-}
-
static int faac_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
unsigned char*)));
dfaac(Decode, (void *FAADAPI (*)(faacDecHandle, faacDecFrameInfo*,
unsigned char*, unsigned long)));
- dfaac(GetErrorMessage, (unsigned char* FAADAPI (*)(unsigned char)));
+ dfaac(GetErrorMessage, (char* FAADAPI (*)(unsigned char)));
#endif
#undef dfacc
return val;
}
+#if 0
static int skip_utf8(GetBitContext *gb)
{
int ones=0, bytes;
}
return 0;
}
+#endif
static int get_crc8(const uint8_t *buf, int count){
int crc=0;
int level= slevel < 0 ? -slevel : slevel;
int sign= slevel < 0 ? 1 : 0;
int bits, len, code;
- int level1, run1;
len_tab[index]= 100;
void *av_malloc(unsigned int size)
{
void *ptr;
+#ifdef MEMALIGN_HACK
int diff;
+#endif
/* lets disallow possible ambiguous cases */
if(size > INT_MAX)
*/
void *av_realloc(void *ptr, unsigned int size)
{
+#ifdef MEMALIGN_HACK
int diff;
+#endif
+
/* lets disallow possible ambiguous cases */
if(size > INT_MAX)
return NULL;
if(avctx->pix_fmt == PIX_FMT_RGBA32){
int x, y, i;
const int linesize= p->linesize[0];
- uint16_t (*buffer)[4]= s->rd_scratchpad;
+ uint16_t (*buffer)[4]= (void *) s->rd_scratchpad;
int left[3], top[3], topleft[3];
for(i=0; i<3; i++){
*my_ptr = 16 * s->mb_y;
}
+#if 0 /* the use of these functions is inside #if 0 */
static int full_motion_search(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int range,
int xmin, int ymin, int xmax, int ymax, uint8_t *ref_picture)
*my_ptr = my;
return dminy;
}
-
+#endif /* 0 */
#define Z_THRESHOLD 256
int dmin_sum=0, mx4_sum=0, my4_sum=0;
int same=1;
const int stride= c->stride;
- const int uvstride= c->uvstride;
uint8_t *mv_penalty= c->current_mv_penalty;
init_mv4_ref(c);
uint8_t * const mv_penalty= c->current_mv_penalty;
int same=1;
const int stride= 2*s->linesize;
- const int uvstride= 2*s->uvlinesize;
int dmin_sum= 0;
const int mot_stride= s->mb_stride;
const int xy= s->mb_x + s->mb_y*mot_stride;
//lets hope gcc will remove the unused vars ...(gcc 3.2.2 seems to do it ...)
#define LOAD_COMMON\
- uint32_t * const score_map= c->score_map;\
- const int xmin= c->xmin;\
- const int ymin= c->ymin;\
- const int xmax= c->xmax;\
- const int ymax= c->ymax;\
+ uint32_t attribute_unused * const score_map= c->score_map;\
+ const int attribute_unused xmin= c->xmin;\
+ const int attribute_unused ymin= c->ymin;\
+ const int attribute_unused xmax= c->xmax;\
+ const int attribute_unused ymax= c->ymax;\
uint8_t *mv_penalty= c->current_mv_penalty;\
const int pred_x= c->pred_x;\
const int pred_y= c->pred_y;\
unsigned char *frame, int buf_size, void *data)
{
Mp3AudioContext *s = avctx->priv_data;
- int len, i;
+ int len;
int lame_result;
/* lame 3.91 dies on '1-channel interleaved' data */
break;
default:
assert(0); //cant happen
+ code = 0; /* kill warning */
}
#if 0
static int dev_4_3_coefs[DEV_ORDER];
+#if 0 /* unused */
static int pow_mult3[3] = {
POW_FIX(1.0),
POW_FIX(1.25992104989487316476),
POW_FIX(1.58740105196819947474),
};
+#endif
static void int_pow_init(void)
{
}
}
+#if 0 /* unused, remove? */
/* return the mantissa and the binary exponent */
static int int_pow(int i, int *exp_ptr)
{
*exp_ptr = eq;
return a;
}
+#endif
static int decode_init(AVCodecContext * avctx)
{
for(i=0; i<4; i++){
int sx= mb_x*16 + 4 + 8*(i&1);
int sy= mb_y*16 + 4 + 8*(i>>1);
- int xy= (mb_x*2 + (i&1) + (mb_y*2 + (i>>1))*mv_stride) << mv_sample_log2-1;
+ int xy= (mb_x*2 + (i&1) + (mb_y*2 + (i>>1))*mv_stride) << (mv_sample_log2-1);
int mx= (pict->motion_val[direction][xy][0]>>shift) + sx;
int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
for(i=0; i<2; i++){
int sx=mb_x*16 + 8;
int sy=mb_y*16 + 4 + 8*i;
- int xy= (mb_x*2 + (mb_y*2 + i)*mv_stride) << mv_sample_log2-1;
+ int xy= (mb_x*2 + (mb_y*2 + i)*mv_stride) << (mv_sample_log2-1);
int mx=(pict->motion_val[direction][xy][0]>>shift);
int my=(pict->motion_val[direction][xy][1]>>shift);
for(i=0; i<2; i++){
int sx=mb_x*16 + 4 + 8*i;
int sy=mb_y*16 + 8;
- int xy= (mb_x*2 + i + mb_y*2*mv_stride) << mv_sample_log2-1;
+ int xy= (mb_x*2 + i + mb_y*2*mv_stride) << (mv_sample_log2-1);
int mx=(pict->motion_val[direction][xy][0]>>shift);
int my=(pict->motion_val[direction][xy][1]>>shift);
int x, y, plane;
int score=0;
int64_t score64=0;
- int64_t threshold;
for(plane=0; plane<3; plane++){
const int stride= p->linesize[plane];
#define MPA_HEADER_SIZE 4
/* header + layer + bitrate + freq + lsf/mpeg25 */
+#undef SAME_HEADER_MASK /* mpegaudio.h defines different version */
#define SAME_HEADER_MASK \
(0xffe00000 | (3 << 17) | (3 << 10) | (3 << 19))
void ff_build_rac_states(RangeCoder *c, int factor, int max_p){
const int64_t one= 1LL<<32;
int64_t p;
- int last_p8, p8, i, j;
+ int last_p8, p8, i;
memset(c->zero_state, 0, sizeof(c->zero_state));
memset(c-> one_state, 0, sizeof(c-> one_state));
static inline int get_rac(RangeCoder *c, uint8_t * const state){
int range1= (c->range * (*state)) >> 8;
- int one_mask;
+ int attribute_unused one_mask;
c->range -= range1;
#if 1
int output_rate, int input_rate)
{
ReSampleContext *s;
- int i;
if ( input_channels > 2)
{
}
}
+#if 0 /* unused, remove? */
static int get_num(GetBitContext *gb)
{
int n, n1;
return (n << 16) | n1;
}
}
+#endif
#endif //CONFIG_ENCODERS
}
static int sonic_decode_frame(AVCodecContext *avctx,
- int16_t *data, int *data_size,
+ void *data, int *data_size,
uint8_t *buf, int buf_size)
{
SonicContext *s = avctx->priv_data;
return value;
}
+#if 0 /* unused, remove? */
static uint16_t svq1_component_checksum (uint16_t *pixels, int pitch,
int width, int height, int value) {
int x, y;
return value;
}
+#endif
static void svq1_parse_string (GetBitContext *bitbuf, uint8_t *out) {
uint8_t seed;
return NULL;
}
-static AVCodec *avcodec_find(enum CodecID id)
-{
- AVCodec *p;
- p = first_avcodec;
- while (p) {
- if (p->id == id)
- return p;
- p = p->next;
- }
- return NULL;
-}
-
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
{
const char *codec_name;
return 0;
}
+#if 0
static int encode_init(AVCodecContext *avctx){
common_init(avctx);
return 0;
}
+#endif
AVCodec vcr1_decoder = {
"vcr1",
return 0;
}
+#if 0 /* unused, remove? */
static int wmv2_encode_end(AVCodecContext *avctx){
if(MPV_encode_end(avctx) < 0)
return 0;
}
+#endif
int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number)
{
{
ByteIOContext *pb = &s->pb;
FFMContext *ffm = s->priv_data;
- int i;
/* flush packets */
if (ffm->packet_ptr > ffm->packet)
AVFormatParameters *ap)
{
int offset, flags;
- AVStream *st;
s->ctx_flags |= AVFMTCTX_NOHEADER; //ok we have a header but theres no fps, codec type, sample_rate, ...
static int http_connect(URLContext *h, const char *path, const char *hoststr,
const char *auth);
static int http_write(URLContext *h, uint8_t *buf, int size);
-static char *b64_encode( unsigned char *src );
+static char *b64_encode(const unsigned char *src );
/* return non zero if error */
* b64_encode: stolen from VLC's http.c
*****************************************************************************/
-static char *b64_encode( unsigned char *src )
+static char *b64_encode( const unsigned char *src )
{
static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
unsigned int len= strlen(src);
return CODEC_ID_NONE;
}
-static const char *av_id2str(const IdStrMap *tags, enum CodecID id)
-{
- while (tags->id) {
- if(tags->id == id)
- return tags->str;
- tags++;
- }
- return NULL;
-}
-
/* return -1 if no image found */
static int find_image_range(int *pfirst_index, int *plast_index,
const char *path)
static int mov_read_ctab(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
- unsigned int len;
- MOV_ctab_t *t;
#if 1
url_fskip(pb, atom.size); // for now
#else
VERY VERY BROKEN, NEVER execute this, needs rewrite
+ unsigned int len;
+ MOV_ctab_t *t;
c->ctab = av_realloc(c->ctab, ++c->ctab_size);
t = c->ctab[c->ctab_size];
t->seed = get_be32(pb);
return updateSize(pb, pos);
}
+#if 0
/* TODO: Not sorted out, but not necessary either */
static int mov_write_iods_tag(ByteIOContext *pb, MOVContext *mov)
{
put_be16(pb, 0x01ff);
return 0x15;
}
+#endif
static int mov_write_mvhd_tag(ByteIOContext *pb, MOVContext *mov)
{
}
+#if 0 /* unused, remove? */
/* return the exact available payload size for the next packet for
stream 'stream_index'. 'pts' and 'dts' are only used to know if
timestamps are needed in the packet header. */
}
return s->packet_size - buf_index;
}
+#endif
/* Write an MPEG padding packet header. */
static void put_padding_packet(AVFormatContext *ctx, ByteIOContext *pb,int packet_bytes)
s->packet_number++;
}
+#if 0 /* unused, remove? */
static int64_t get_vcd_scr(AVFormatContext *ctx,int stream_index,int64_t pts)
{
MpegMuxContext *s = ctx->priv_data;
return scr;
}
+#endif
static int remove_decoded_packets(AVFormatContext *ctx, int64_t scr){
// MpegMuxContext *s = ctx->priv_data;
return val;
}
+#if 0 /* unused, remove? */
/* XXX: optimize */
static int find_prev_start_code(ByteIOContext *pb, int *size_ptr)
{
*size_ptr = pos_start - pos;
return start_code;
}
+#endif
/* read the next PES header. Return its position in ppos
(if not NULL), and its start code, pts and dts.
{
NSVContext *nsv = s->priv_data;
ByteIOContext *pb = &s->pb;
- uint32_t tag, tag1, handler;
- int codec_type, stream_index, frame_period, bit_rate, scale, rate;
- unsigned int file_size, size, nb_frames;
+ unsigned int file_size, size;
int64_t duration;
int strings_size;
int table_entries;
int table_entries_used;
- int i, n;
- AVStream *st;
- NSVStream *ast;
PRINT(("%s()\n", __FUNCTION__));
static int nsv_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
NSVContext *nsv = s->priv_data;
- ByteIOContext *pb = &s->pb;
- uint32_t tag, tag1, handler;
- int codec_type, stream_index, frame_period, bit_rate, scale, rate;
- unsigned int size, nb_frames;
- int table_entries;
- int i, n, err;
- AVStream *st;
- NSVStream *ast;
+ int i, err;
PRINT(("%s()\n", __FUNCTION__));
PRINT(("filename '%s'\n", s->filename));
AVStream *st[2] = {NULL, NULL};
NSVStream *nst;
AVPacket *pkt;
- uint32_t v = 0;
int i, err = 0;
uint8_t auxcount; /* number of aux metadata, also 4 bits of vsize */
uint32_t vsize;
static int nsv_read_packet(AVFormatContext *s, AVPacket *pkt)
{
NSVContext *nsv = s->priv_data;
- ByteIOContext *pb = &s->pb;
int i, err = 0;
PRINT(("%s()\n", __FUNCTION__));
static int nsv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
{
+#if 0
NSVContext *avi = s->priv_data;
AVStream *st;
NSVStream *ast;
int frame_number, i;
int64_t pos;
+#endif
return -1;
}
static int nsv_read_close(AVFormatContext *s)
{
- int i;
+/* int i; */
NSVContext *nsv = s->priv_data;
if (nsv->index_entries)
}
if(!strcmp(type, "v")){
- int value= get_v(bc);
+ get_v(bc);
}else{
if(!strcmp(name, "Author"))
get_str(bc, s->author, sizeof(s->author));
return 50;
}
+#if 0
static void dump(unsigned char *buf,size_t len)
{
int i;
}
av_log(NULL, AV_LOG_DEBUG, "\n");
}
+#endif
static int str_read_header(AVFormatContext *s,
AVFormatParameters *ap)
struct sockaddr_in dest_addr;
char hostname[1024], *q;
int port, fd = -1;
- TCPContext *s;
- const char *p;
+ TCPContext *s = NULL;
fd_set wfds;
int fd_max, ret;
struct timeval tv;
socklen_t addrlen;
char sbuf[NI_MAXSERV];
char hbuf[NI_MAXHOST];
- struct addrinfo *res0;
+ struct addrinfo *res0 = NULL;
int family;
if (s->local_port != 0) {
res0 = udp_ipv6_resolve_host(0, s->local_port, SOCK_DGRAM, AF_UNSPEC, AI_PASSIVE);
- if (res0 == 0) return -1;
+ if (res0 == 0)
+ goto fail;
family = res0->ai_family;
- freeaddrinfo(res0);
} else {
family = s->dest_addr.ss_family;
}
perror("bind");
goto fail;
}
+ freeaddrinfo(res0);
+ res0 = NULL;
}
addrlen = sizeof(clientaddr);
#else
close(udp_fd);
#endif
+ if(res0)
+ freeaddrinfo(res0);
return -1;
}
/* return non zero if error */
static int udp_open(URLContext *h, const char *uri, int flags)
{
- struct sockaddr_in my_addr, my_addr1;
char hostname[1024];
int port, udp_fd = -1, tmp;
UDPContext *s = NULL;
- int is_output, len;
+ int is_output;
const char *p;
char buf[256];
+#ifndef CONFIG_IPV6
+ struct sockaddr_in my_addr, my_addr1;
+ int len;
+#endif
h->is_streamed = 1;
h->max_packet_size = 1472;
}
static int av_seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos, int flags){
- AVInputFormat *avif= s->iformat;
int64_t pos_min, pos_max;
#if 0
AVStream *st;
void write_audio_frame(AVFormatContext *oc, AVStream *st)
{
- int out_size;
AVCodecContext *c;
AVPacket pkt;
av_init_packet(&pkt);