Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
ffmpeg
Commits
a92be9b8
Commit
a92be9b8
authored
Jun 06, 2011
by
Diego Biurrun
Browse files
Replace memset(0) by zero initializations.
Also remove one pointless zero initialization in rangecoder.c.
parent
856c8e0a
Changes
39
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
42 additions
and
90 deletions
+42
-90
avplay.c
avplay.c
+1
-2
avserver.c
avserver.c
+3
-6
libavcodec/4xm.c
libavcodec/4xm.c
+2
-4
libavcodec/aaccoder.c
libavcodec/aaccoder.c
+1
-2
libavcodec/aacpsy.c
libavcodec/aacpsy.c
+2
-4
libavcodec/ac3dec.c
libavcodec/ac3dec.c
+1
-3
libavcodec/alsdec.c
libavcodec/alsdec.c
+3
-8
libavcodec/bink.c
libavcodec/bink.c
+1
-2
libavcodec/cook.c
libavcodec/cook.c
+6
-14
libavcodec/dvdsubdec.c
libavcodec/dvdsubdec.c
+2
-4
libavcodec/dxva2.c
libavcodec/dxva2.c
+1
-2
libavcodec/flac_parser.c
libavcodec/flac_parser.c
+1
-2
libavcodec/intrax8dsp.c
libavcodec/intrax8dsp.c
+2
-4
libavcodec/jpeglsenc.c
libavcodec/jpeglsenc.c
+1
-2
libavcodec/libxvid_rc.c
libavcodec/libxvid_rc.c
+3
-6
libavcodec/libxvidff.c
libavcodec/libxvidff.c
+7
-14
libavcodec/mjpegdec.c
libavcodec/mjpegdec.c
+1
-2
libavcodec/motion_est.c
libavcodec/motion_est.c
+1
-2
libavcodec/mpegaudiodec.c
libavcodec/mpegaudiodec.c
+2
-5
libavcodec/ra144enc.c
libavcodec/ra144enc.c
+1
-2
No files found.
avplay.c
View file @
a92be9b8
...
...
@@ -1371,7 +1371,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
/* if the frame is not skipped, then display it */
if
(
vp
->
bmp
)
{
AVPicture
pict
;
AVPicture
pict
=
{
{
0
}
}
;
#if CONFIG_AVFILTER
if
(
vp
->
picref
)
avfilter_unref_buffer
(
vp
->
picref
);
...
...
@@ -1381,7 +1381,6 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
/* get a pointer on the bitmap */
SDL_LockYUVOverlay
(
vp
->
bmp
);
memset
(
&
pict
,
0
,
sizeof
(
AVPicture
));
pict
.
data
[
0
]
=
vp
->
bmp
->
pixels
[
0
];
pict
.
data
[
1
]
=
vp
->
bmp
->
pixels
[
2
];
pict
.
data
[
2
]
=
vp
->
bmp
->
pixels
[
1
];
...
...
avserver.c
View file @
a92be9b8
...
...
@@ -335,8 +335,7 @@ static int resolve_host(struct in_addr *sin_addr, const char *hostname)
if
(
!
ff_inet_aton
(
hostname
,
sin_addr
))
{
#if HAVE_GETADDRINFO
struct
addrinfo
*
ai
,
*
cur
;
struct
addrinfo
hints
;
memset
(
&
hints
,
0
,
sizeof
(
hints
));
struct
addrinfo
hints
=
{
0
};
hints
.
ai_family
=
AF_INET
;
if
(
getaddrinfo
(
hostname
,
NULL
,
&
hints
,
&
ai
))
return
-
1
;
...
...
@@ -2822,7 +2821,7 @@ static int rtsp_parse_request(HTTPContext *c)
char
protocol
[
32
];
char
line
[
1024
];
int
len
;
RTSPMessageHeader
header1
,
*
header
=
&
header1
;
RTSPMessageHeader
header1
=
{
0
}
,
*
header
=
&
header1
;
c
->
buffer_ptr
[
0
]
=
'\0'
;
p
=
c
->
buffer
;
...
...
@@ -2848,7 +2847,6 @@ static int rtsp_parse_request(HTTPContext *c)
}
/* parse each header line */
memset
(
header
,
0
,
sizeof
(
*
header
));
/* skip to next line */
while
(
*
p
!=
'\n'
&&
*
p
!=
'\0'
)
p
++
;
...
...
@@ -4647,7 +4645,7 @@ static const OptionDef options[] = {
int
main
(
int
argc
,
char
**
argv
)
{
struct
sigaction
sigact
;
struct
sigaction
sigact
=
{
{
0
}
}
;
parse_loglevel
(
argc
,
argv
,
options
);
av_register_all
();
...
...
@@ -4665,7 +4663,6 @@ int main(int argc, char **argv)
av_lfg_init
(
&
random_state
,
av_get_random_seed
());
memset
(
&
sigact
,
0
,
sizeof
(
sigact
));
sigact
.
sa_handler
=
handle_child_exit
;
sigact
.
sa_flags
=
SA_NOCLDSTOP
|
SA_RESTART
;
sigaction
(
SIGCHLD
,
&
sigact
,
0
);
...
...
libavcodec/4xm.c
View file @
a92be9b8
...
...
@@ -552,7 +552,7 @@ static int decode_i_mb(FourXContext *f)
static
const
uint8_t
*
read_huffman_tables
(
FourXContext
*
f
,
const
uint8_t
*
const
buf
)
{
int
frequency
[
512
];
int
frequency
[
512
]
=
{
0
}
;
uint8_t
flag
[
512
];
int
up
[
512
];
uint8_t
len_tab
[
257
];
...
...
@@ -561,7 +561,6 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
const
uint8_t
*
ptr
=
buf
;
int
j
;
memset
(
frequency
,
0
,
sizeof
(
frequency
));
memset
(
up
,
-
1
,
sizeof
(
up
));
start
=
*
ptr
++
;
...
...
@@ -661,8 +660,7 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
for
(
y
=
0
;
y
<
height
;
y
+=
16
)
{
for
(
x
=
0
;
x
<
width
;
x
+=
16
)
{
unsigned
int
color
[
4
],
bits
;
memset
(
color
,
0
,
sizeof
(
color
));
unsigned
int
color
[
4
]
=
{
0
},
bits
;
// warning following is purely guessed ...
color
[
0
]
=
bytestream2_get_le16u
(
&
g3
);
color
[
1
]
=
bytestream2_get_le16u
(
&
g3
);
...
...
libavcodec/aaccoder.c
View file @
a92be9b8
...
...
@@ -714,7 +714,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
{
int
start
=
0
,
i
,
w
,
w2
,
g
;
int
destbits
=
avctx
->
bit_rate
*
1024
.
0
/
avctx
->
sample_rate
/
avctx
->
channels
;
float
dists
[
128
],
uplims
[
128
];
float
dists
[
128
]
=
{
0
}
,
uplims
[
128
];
float
maxvals
[
128
];
int
fflag
,
minscaler
;
int
its
=
0
;
...
...
@@ -722,7 +722,6 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
float
minthr
=
INFINITY
;
//XXX: some heuristic to determine initial quantizers will reduce search time
memset
(
dists
,
0
,
sizeof
(
dists
));
//determine zero bands and upper limits
for
(
w
=
0
;
w
<
sce
->
ics
.
num_windows
;
w
+=
sce
->
ics
.
group_len
[
w
])
{
for
(
g
=
0
;
g
<
sce
->
ics
.
num_swb
;
g
++
)
{
...
...
libavcodec/aacpsy.c
View file @
a92be9b8
...
...
@@ -389,9 +389,8 @@ static av_unused FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
AacPsyChannel
*
pch
=
&
pctx
->
ch
[
channel
];
uint8_t
grouping
=
0
;
int
next_type
=
pch
->
next_window_seq
;
FFPsyWindowInfo
wi
;
FFPsyWindowInfo
wi
=
{
{
0
}
}
;
memset
(
&
wi
,
0
,
sizeof
(
wi
));
if
(
la
)
{
float
s
[
8
],
v
;
int
switch_to_eight
=
0
;
...
...
@@ -785,9 +784,8 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
int
uselongblock
=
1
;
int
attacks
[
AAC_NUM_BLOCKS_SHORT
+
1
]
=
{
0
};
int
i
;
FFPsyWindowInfo
wi
;
FFPsyWindowInfo
wi
=
{
{
0
}
}
;
memset
(
&
wi
,
0
,
sizeof
(
wi
));
if
(
la
)
{
float
hpfsmpl
[
AAC_BLOCK_SIZE_LONG
];
float
const
*
pf
=
hpfsmpl
;
...
...
libavcodec/ac3dec.c
View file @
a92be9b8
...
...
@@ -753,9 +753,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
int
downmix_output
;
int
cpl_in_use
;
GetBitContext
*
gbc
=
&
s
->
gbc
;
uint8_t
bit_alloc_stages
[
AC3_MAX_CHANNELS
];
memset
(
bit_alloc_stages
,
0
,
AC3_MAX_CHANNELS
);
uint8_t
bit_alloc_stages
[
AC3_MAX_CHANNELS
]
=
{
0
};
/* block switch flags */
different_transforms
=
0
;
...
...
libavcodec/alsdec.c
View file @
a92be9b8
...
...
@@ -1026,9 +1026,7 @@ static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame,
unsigned
int
*
js_blocks
)
{
unsigned
int
b
;
ALSBlockData
bd
;
memset
(
&
bd
,
0
,
sizeof
(
ALSBlockData
));
ALSBlockData
bd
=
{
0
};
bd
.
ra_block
=
ra_frame
;
bd
.
const_block
=
ctx
->
const_block
;
...
...
@@ -1069,9 +1067,7 @@ static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame,
ALSSpecificConfig
*
sconf
=
&
ctx
->
sconf
;
unsigned
int
offset
=
0
;
unsigned
int
b
;
ALSBlockData
bd
[
2
];
memset
(
bd
,
0
,
2
*
sizeof
(
ALSBlockData
));
ALSBlockData
bd
[
2
]
=
{
{
0
}
};
bd
[
0
].
ra_block
=
ra_frame
;
bd
[
0
].
const_block
=
ctx
->
const_block
;
...
...
@@ -1337,7 +1333,7 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
sizeof
(
*
ctx
->
raw_samples
[
c
])
*
sconf
->
max_order
);
}
}
else
{
// multi-channel coding
ALSBlockData
bd
;
ALSBlockData
bd
=
{
0
}
;
int
b
;
int
*
reverted_channels
=
ctx
->
reverted_channels
;
unsigned
int
offset
=
0
;
...
...
@@ -1348,7 +1344,6 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
return
-
1
;
}
memset
(
&
bd
,
0
,
sizeof
(
ALSBlockData
));
memset
(
reverted_channels
,
0
,
sizeof
(
*
reverted_channels
)
*
avctx
->
channels
);
bd
.
ra_block
=
ra_frame
;
...
...
libavcodec/bink.c
View file @
a92be9b8
...
...
@@ -233,7 +233,7 @@ static void merge(GetBitContext *gb, uint8_t *dst, uint8_t *src, int size)
*/
static
void
read_tree
(
GetBitContext
*
gb
,
Tree
*
tree
)
{
uint8_t
tmp1
[
16
],
tmp2
[
16
],
*
in
=
tmp1
,
*
out
=
tmp2
;
uint8_t
tmp1
[
16
]
=
{
0
}
,
tmp2
[
16
],
*
in
=
tmp1
,
*
out
=
tmp2
;
int
i
,
t
,
len
;
tree
->
vlc_num
=
get_bits
(
gb
,
4
);
...
...
@@ -244,7 +244,6 @@ static void read_tree(GetBitContext *gb, Tree *tree)
}
if
(
get_bits1
(
gb
))
{
len
=
get_bits
(
gb
,
3
);
memset
(
tmp1
,
0
,
sizeof
(
tmp1
));
for
(
i
=
0
;
i
<=
len
;
i
++
)
{
tree
->
syms
[
i
]
=
get_bits
(
gb
,
4
);
tmp1
[
tree
->
syms
[
i
]]
=
1
;
...
...
libavcodec/cook.c
View file @
a92be9b8
...
...
@@ -411,10 +411,10 @@ static void categorize(COOKContext *q, COOKSubpacket *p, int *quant_index_table,
int
*
category
,
int
*
category_index
)
{
int
exp_idx
,
bias
,
tmpbias1
,
tmpbias2
,
bits_left
,
num_bits
,
index
,
v
,
i
,
j
;
int
exp_index2
[
102
];
int
exp_index1
[
102
];
int
exp_index2
[
102
]
=
{
0
}
;
int
exp_index1
[
102
]
=
{
0
}
;
int
tmp_categorize_array
[
128
*
2
];
int
tmp_categorize_array
[
128
*
2
]
=
{
0
}
;
int
tmp_categorize_array1_idx
=
p
->
numvector_size
;
int
tmp_categorize_array2_idx
=
p
->
numvector_size
;
...
...
@@ -426,10 +426,6 @@ static void categorize(COOKContext *q, COOKSubpacket *p, int *quant_index_table,
//av_log(q->avctx, AV_LOG_ERROR, "bits_left = %d\n",bits_left);
}
memset
(
&
exp_index1
,
0
,
sizeof
(
exp_index1
));
memset
(
&
exp_index2
,
0
,
sizeof
(
exp_index2
));
memset
(
&
tmp_categorize_array
,
0
,
sizeof
(
tmp_categorize_array
));
bias
=
-
32
;
/* Estimate bias. */
...
...
@@ -649,14 +645,11 @@ static void decode_vectors(COOKContext *q, COOKSubpacket *p, int *category,
*/
static
int
mono_decode
(
COOKContext
*
q
,
COOKSubpacket
*
p
,
float
*
mlt_buffer
)
{
int
category_index
[
128
];
int
category_index
[
128
]
=
{
0
};
int
category
[
128
]
=
{
0
};
int
quant_index_table
[
102
];
int
category
[
128
];
int
res
;
memset
(
&
category
,
0
,
sizeof
(
category
));
memset
(
&
category_index
,
0
,
sizeof
(
category_index
));
if
((
res
=
decode_envelope
(
q
,
p
,
quant_index_table
))
<
0
)
return
res
;
q
->
num_vectors
=
get_bits
(
&
q
->
gb
,
p
->
log2_numvector_size
);
...
...
@@ -818,13 +811,12 @@ static int joint_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer1,
float
*
mlt_buffer2
)
{
int
i
,
j
,
res
;
int
decouple_tab
[
SUBBAND_SIZE
];
int
decouple_tab
[
SUBBAND_SIZE
]
=
{
0
}
;
float
*
decode_buffer
=
q
->
decode_buffer_0
;
int
idx
,
cpl_tmp
;
float
f1
,
f2
;
const
float
*
cplscale
;
memset
(
decouple_tab
,
0
,
sizeof
(
decouple_tab
));
memset
(
decode_buffer
,
0
,
sizeof
(
q
->
decode_buffer_0
));
/* Make sure the buffers are zeroed out. */
...
...
libavcodec/dvdsubdec.c
View file @
a92be9b8
...
...
@@ -120,13 +120,12 @@ static void guess_palette(uint32_t *rgba_palette,
uint8_t
*
alpha
,
uint32_t
subtitle_color
)
{
uint8_t
color_used
[
16
];
uint8_t
color_used
[
16
]
=
{
0
}
;
int
nb_opaque_colors
,
i
,
level
,
j
,
r
,
g
,
b
;
for
(
i
=
0
;
i
<
4
;
i
++
)
rgba_palette
[
i
]
=
0
;
memset
(
color_used
,
0
,
16
);
nb_opaque_colors
=
0
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
alpha
[
i
]
!=
0
&&
!
color_used
[
colormap
[
i
]])
{
...
...
@@ -371,14 +370,13 @@ static int is_transp(const uint8_t *buf, int pitch, int n,
/* return 0 if empty rectangle, 1 if non empty */
static
int
find_smallest_bounding_rectangle
(
AVSubtitle
*
s
)
{
uint8_t
transp_color
[
256
];
uint8_t
transp_color
[
256
]
=
{
0
}
;
int
y1
,
y2
,
x1
,
x2
,
y
,
w
,
h
,
i
;
uint8_t
*
bitmap
;
if
(
s
->
num_rects
==
0
||
s
->
rects
==
NULL
||
s
->
rects
[
0
]
->
w
<=
0
||
s
->
rects
[
0
]
->
h
<=
0
)
return
0
;
memset
(
transp_color
,
0
,
256
);
for
(
i
=
0
;
i
<
s
->
rects
[
0
]
->
nb_colors
;
i
++
)
{
if
((((
uint32_t
*
)
s
->
rects
[
0
]
->
pict
.
data
[
1
])[
i
]
>>
24
)
==
0
)
transp_color
[
i
]
=
1
;
...
...
libavcodec/dxva2.c
View file @
a92be9b8
...
...
@@ -86,7 +86,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, MpegEncContext *s,
struct
dxva_context
*
ctx
=
avctx
->
hwaccel_context
;
unsigned
buffer_count
=
0
;
DXVA2_DecodeBufferDesc
buffer
[
4
];
DXVA2_DecodeExecuteParams
exec
;
DXVA2_DecodeExecuteParams
exec
=
{
0
}
;
int
result
;
if
(
FAILED
(
IDirectXVideoDecoder_BeginFrame
(
ctx
->
decoder
,
...
...
@@ -132,7 +132,6 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, MpegEncContext *s,
assert
(
buffer_count
==
1
+
(
qm_size
>
0
)
+
2
);
memset
(
&
exec
,
0
,
sizeof
(
exec
));
exec
.
NumCompBuffers
=
buffer_count
;
exec
.
pCompressedBuffers
=
buffer
;
exec
.
pExtensionData
=
NULL
;
...
...
libavcodec/flac_parser.c
View file @
a92be9b8
...
...
@@ -573,8 +573,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
av_fifo_generic_write
(
fpc
->
fifo_buf
,
(
void
*
)
read_start
,
read_end
-
read_start
,
NULL
);
}
else
{
int8_t
pad
[
MAX_FRAME_HEADER_SIZE
];
memset
(
pad
,
0
,
sizeof
(
pad
));
int8_t
pad
[
MAX_FRAME_HEADER_SIZE
]
=
{
0
};
av_fifo_generic_write
(
fpc
->
fifo_buf
,
(
void
*
)
pad
,
sizeof
(
pad
),
NULL
);
}
...
...
libavcodec/intrax8dsp.c
View file @
a92be9b8
...
...
@@ -152,10 +152,8 @@ static void spatial_compensation_0(uint8_t *src , uint8_t *dst, int linesize){
int
x
,
y
;
unsigned
int
p
;
//power divided by 2
int
a
;
uint16_t
left_sum
[
2
][
8
];
uint16_t
top_sum
[
2
][
8
];
memset
(
left_sum
,
0
,
2
*
8
*
sizeof
(
uint16_t
));
memset
(
top_sum
,
0
,
2
*
8
*
sizeof
(
uint16_t
));
uint16_t
left_sum
[
2
][
8
]
=
{
{
0
}
};
uint16_t
top_sum
[
2
][
8
]
=
{
{
0
}
};
for
(
i
=
0
;
i
<
8
;
i
++
){
a
=
src
[
area2
+
7
-
i
]
<<
4
;
...
...
libavcodec/jpeglsenc.c
View file @
a92be9b8
...
...
@@ -210,8 +210,7 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last
static
void
ls_store_lse
(
JLSState
*
state
,
PutBitContext
*
pb
){
/* Test if we have default params and don't need to store LSE */
JLSState
state2
;
memset
(
&
state2
,
0
,
sizeof
(
JLSState
));
JLSState
state2
=
{
0
};
state2
.
bpp
=
state
->
bpp
;
state2
.
near
=
state
->
near
;
ff_jpegls_reset_coding_parameters
(
&
state2
,
1
);
...
...
libavcodec/libxvid_rc.c
View file @
a92be9b8
...
...
@@ -35,8 +35,8 @@ extern unsigned int xvid_debug;
int
ff_xvid_rate_control_init
(
MpegEncContext
*
s
){
char
*
tmp_name
;
int
fd
,
i
;
xvid_plg_create_t
xvid_plg_create
;
xvid_plugin_2pass2_t
xvid_2pass2
;
xvid_plg_create_t
xvid_plg_create
=
{
0
}
;
xvid_plugin_2pass2_t
xvid_2pass2
=
{
0
}
;
//xvid_debug=-1;
...
...
@@ -63,7 +63,6 @@ int ff_xvid_rate_control_init(MpegEncContext *s){
close
(
fd
);
memset
(
&
xvid_2pass2
,
0
,
sizeof
(
xvid_2pass2
));
xvid_2pass2
.
version
=
XVID_MAKE_VERSION
(
1
,
1
,
0
);
xvid_2pass2
.
filename
=
tmp_name
;
xvid_2pass2
.
bitrate
=
s
->
avctx
->
bit_rate
;
...
...
@@ -71,7 +70,6 @@ int ff_xvid_rate_control_init(MpegEncContext *s){
xvid_2pass2
.
vbv_maxrate
=
s
->
avctx
->
rc_max_rate
;
xvid_2pass2
.
vbv_initial
=
s
->
avctx
->
rc_initial_buffer_occupancy
;
memset
(
&
xvid_plg_create
,
0
,
sizeof
(
xvid_plg_create
));
xvid_plg_create
.
version
=
XVID_MAKE_VERSION
(
1
,
1
,
0
);
xvid_plg_create
.
fbase
=
s
->
avctx
->
time_base
.
den
;
xvid_plg_create
.
fincr
=
s
->
avctx
->
time_base
.
num
;
...
...
@@ -85,9 +83,8 @@ int ff_xvid_rate_control_init(MpegEncContext *s){
}
float
ff_xvid_rate_estimate_qscale
(
MpegEncContext
*
s
,
int
dry_run
){
xvid_plg_data_t
xvid_plg_data
;
xvid_plg_data_t
xvid_plg_data
=
{
0
}
;
memset
(
&
xvid_plg_data
,
0
,
sizeof
(
xvid_plg_data
));
xvid_plg_data
.
version
=
XVID_MAKE_VERSION
(
1
,
1
,
0
);
xvid_plg_data
.
width
=
s
->
width
;
xvid_plg_data
.
height
=
s
->
height
;
...
...
libavcodec/libxvidff.c
View file @
a92be9b8
...
...
@@ -131,11 +131,11 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
uint16_t
*
intra
,
*
inter
;
int
fd
;
xvid_plugin_single_t
single
;
struct
xvid_ff_pass1
rc2pass1
;
xvid_plugin_2pass2_t
rc2pass2
;
xvid_gbl_init_t
xvid_gbl_init
;
xvid_enc_create_t
xvid_enc_create
;
xvid_plugin_single_t
single
=
{
0
}
;
struct
xvid_ff_pass1
rc2pass1
=
{
0
}
;
xvid_plugin_2pass2_t
rc2pass2
=
{
0
}
;
xvid_gbl_init_t
xvid_gbl_init
=
{
0
}
;
xvid_enc_create_t
xvid_enc_create
=
{
0
}
;
xvid_enc_plugin_t
plugins
[
7
];
/* Bring in VOP flags from avconv command-line */
...
...
@@ -205,7 +205,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
x
->
me_flags
|=
XVID_ME_QUARTERPELREFINE8
;
}
memset
(
&
xvid_gbl_init
,
0
,
sizeof
(
xvid_gbl_init
));
xvid_gbl_init
.
version
=
XVID_VERSION
;
xvid_gbl_init
.
debug
=
0
;
...
...
@@ -226,7 +225,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
xvid_global
(
NULL
,
XVID_GBL_INIT
,
&
xvid_gbl_init
,
NULL
);
/* Create the encoder reference */
memset
(
&
xvid_enc_create
,
0
,
sizeof
(
xvid_enc_create
));
xvid_enc_create
.
version
=
XVID_VERSION
;
/* Store the desired frame size */
...
...
@@ -251,7 +249,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
x
->
twopassfile
=
NULL
;
if
(
xvid_flags
&
CODEC_FLAG_PASS1
)
{
memset
(
&
rc2pass1
,
0
,
sizeof
(
struct
xvid_ff_pass1
));
rc2pass1
.
version
=
XVID_VERSION
;
rc2pass1
.
context
=
x
;
x
->
twopassbuffer
=
av_malloc
(
BUFFER_SIZE
);
...
...
@@ -267,7 +264,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
plugins
[
xvid_enc_create
.
num_plugins
].
param
=
&
rc2pass1
;
xvid_enc_create
.
num_plugins
++
;
}
else
if
(
xvid_flags
&
CODEC_FLAG_PASS2
)
{
memset
(
&
rc2pass2
,
0
,
sizeof
(
xvid_plugin_2pass2_t
));
rc2pass2
.
version
=
XVID_VERSION
;
rc2pass2
.
bitrate
=
avctx
->
bit_rate
;
...
...
@@ -299,7 +295,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
xvid_enc_create
.
num_plugins
++
;
}
else
if
(
!
(
xvid_flags
&
CODEC_FLAG_QSCALE
)
)
{
/* Single Pass Bitrate Control! */
memset
(
&
single
,
0
,
sizeof
(
xvid_plugin_single_t
));
single
.
version
=
XVID_VERSION
;
single
.
bitrate
=
avctx
->
bit_rate
;
...
...
@@ -419,8 +414,8 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int
mb_width
=
(
avctx
->
width
+
15
)
/
16
;
int
mb_height
=
(
avctx
->
height
+
15
)
/
16
;
xvid_enc_frame_t
xvid_enc_frame
;
xvid_enc_stats_t
xvid_enc_stats
;
xvid_enc_frame_t
xvid_enc_frame
=
{
0
}
;
xvid_enc_stats_t
xvid_enc_stats
=
{
0
}
;
if
(
!
user_packet
&&
(
ret
=
av_new_packet
(
pkt
,
mb_width
*
mb_height
*
MAX_MB_BYTES
+
FF_MIN_BUFFER_SIZE
))
<
0
)
{
...
...
@@ -429,9 +424,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
/* Start setting up the frame */
memset
(
&
xvid_enc_frame
,
0
,
sizeof
(
xvid_enc_frame
));
xvid_enc_frame
.
version
=
XVID_VERSION
;
memset
(
&
xvid_enc_stats
,
0
,
sizeof
(
xvid_enc_stats
));
xvid_enc_stats
.
version
=
XVID_VERSION
;
*
p
=
*
picture
;
...
...
libavcodec/mjpegdec.c
View file @
a92be9b8
...
...
@@ -46,14 +46,13 @@ static int build_vlc(VLC *vlc, const uint8_t *bits_table,
const
uint8_t
*
val_table
,
int
nb_codes
,
int
use_static
,
int
is_ac
)
{
uint8_t
huff_size
[
256
];
uint8_t
huff_size
[
256
]
=
{
0
}
;
uint16_t
huff_code
[
256
];
uint16_t
huff_sym
[
256
];
int
i
;
assert
(
nb_codes
<=
256
);
memset
(
huff_size
,
0
,
sizeof
(
huff_size
));
ff_mjpeg_build_huffman_codes
(
huff_size
,
huff_code
,
bits_table
,
val_table
);
for
(
i
=
0
;
i
<
256
;
i
++
)
...
...
libavcodec/motion_est.c
View file @
a92be9b8
...
...
@@ -1424,9 +1424,8 @@ static inline int bidir_refine(MpegEncContext * s, int mb_x, int mb_y)
#define HASH(fx,fy,bx,by) ((fx)+17*(fy)+63*(bx)+117*(by))
#define HASH8(fx,fy,bx,by) ((uint8_t)HASH(fx,fy,bx,by))
int
hashidx
=
HASH
(
motion_fx
,
motion_fy
,
motion_bx
,
motion_by
);
uint8_t
map
[
256
];
uint8_t
map
[
256
]
=
{
0
}
;
memset
(
map
,
0
,
sizeof
(
map
));
map
[
hashidx
&
255
]
=
1
;
fbmin
=
check_bidir_mv
(
s
,
motion_fx
,
motion_fy
,
...
...
libavcodec/mpegaudiodec.c
View file @
a92be9b8
...
...
@@ -304,11 +304,8 @@ static av_cold void decode_init_static(void)
for
(
i
=
1
;
i
<
16
;
i
++
)
{
const
HuffTable
*
h
=
&
mpa_huff_tables
[
i
];
int
xsize
,
x
,
y
;
uint8_t
tmp_bits
[
512
];
uint16_t
tmp_codes
[
512
];
memset
(
tmp_bits
,
0
,
sizeof
(
tmp_bits
));
memset
(
tmp_codes
,
0
,
sizeof
(
tmp_codes
));
uint8_t
tmp_bits
[
512
]
=
{
0
};
uint16_t
tmp_codes
[
512
]
=
{
0
};
xsize
=
h
->
xsize
;
...
...
libavcodec/ra144enc.c
View file @
a92be9b8
...
...
@@ -342,7 +342,7 @@ static void ra144_encode_subblock(RA144Context *ractx,
const
int16_t
*
lpc_coefs
,
unsigned
int
rms
,
PutBitContext
*
pb
)
{
float
data
[
BLOCKSIZE
],
work
[
LPC_ORDER
+
BLOCKSIZE
];
float
data
[
BLOCKSIZE
]
=
{
0
}
,
work
[
LPC_ORDER
+
BLOCKSIZE
];
float
coefs
[
LPC_ORDER
];
float
zero
[
BLOCKSIZE
],
cba
[
BLOCKSIZE
],
cb1
[
BLOCKSIZE
],
cb2
[
BLOCKSIZE
];
int16_t
cba_vect
[
BLOCKSIZE
];
...
...
@@ -360,7 +360,6 @@ static void ra144_encode_subblock(RA144Context *ractx,
* Calculate the zero-input response of the LPC filter and subtract it from
* input data.
*/
memset
(
data
,
0
,
sizeof
(
data
));
ff_celp_lp_synthesis_filterf
(
work
+
LPC_ORDER
,
coefs
,
data
,
BLOCKSIZE
,
LPC_ORDER
);
for
(
i
=
0
;
i
<
BLOCKSIZE
;
i
++
)
{
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment