| ... | ... |
@@ -1117,7 +1117,7 @@ static void do_video_out(AVFormatContext *s, |
| 1117 | 1117 |
int *frame_size) |
| 1118 | 1118 |
{
|
| 1119 | 1119 |
int nb_frames, i, ret, resample_changed; |
| 1120 |
- AVFrame *final_picture, *formatted_picture, *resampling_dst; |
|
| 1120 |
+ AVFrame *final_picture, *formatted_picture; |
|
| 1121 | 1121 |
AVCodecContext *enc, *dec; |
| 1122 | 1122 |
double sync_ipts; |
| 1123 | 1123 |
|
| ... | ... |
@@ -1162,7 +1162,6 @@ static void do_video_out(AVFormatContext *s, |
| 1162 | 1162 |
|
| 1163 | 1163 |
formatted_picture = in_picture; |
| 1164 | 1164 |
final_picture = formatted_picture; |
| 1165 |
- resampling_dst = &ost->pict_tmp; |
|
| 1166 | 1165 |
|
| 1167 | 1166 |
resample_changed = ost->resample_width != dec->width || |
| 1168 | 1167 |
ost->resample_height != dec->height || |
| ... | ... |
@@ -1198,7 +1197,7 @@ static void do_video_out(AVFormatContext *s, |
| 1198 | 1198 |
} |
| 1199 | 1199 |
} |
| 1200 | 1200 |
sws_scale(ost->img_resample_ctx, formatted_picture->data, formatted_picture->linesize, |
| 1201 |
- 0, ost->resample_height, resampling_dst->data, resampling_dst->linesize); |
|
| 1201 |
+ 0, ost->resample_height, final_picture->data, final_picture->linesize); |
|
| 1202 | 1202 |
} |
| 1203 | 1203 |
#endif |
| 1204 | 1204 |
|
| ... | ... |
@@ -3617,7 +3616,6 @@ static void new_audio_stream(AVFormatContext *oc, int file_idx) |
| 3617 | 3617 |
static void new_data_stream(AVFormatContext *oc, int file_idx) |
| 3618 | 3618 |
{
|
| 3619 | 3619 |
AVStream *st; |
| 3620 |
- AVOutputStream *ost; |
|
| 3621 | 3620 |
AVCodec *codec=NULL; |
| 3622 | 3621 |
AVCodecContext *data_enc; |
| 3623 | 3622 |
|
| ... | ... |
@@ -3626,7 +3624,7 @@ static void new_data_stream(AVFormatContext *oc, int file_idx) |
| 3626 | 3626 |
fprintf(stderr, "Could not alloc stream\n"); |
| 3627 | 3627 |
ffmpeg_exit(1); |
| 3628 | 3628 |
} |
| 3629 |
- ost = new_output_stream(oc, file_idx); |
|
| 3629 |
+ new_output_stream(oc, file_idx); |
|
| 3630 | 3630 |
data_enc = st->codec; |
| 3631 | 3631 |
output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1); |
| 3632 | 3632 |
if (!data_stream_copy) {
|
| ... | ... |
@@ -252,7 +252,6 @@ static int a64multi_encode_frame(AVCodecContext *avctx, unsigned char *buf, |
| 252 | 252 |
int b_width; |
| 253 | 253 |
|
| 254 | 254 |
int req_size; |
| 255 |
- int num_frames = c->mc_lifetime; |
|
| 256 | 255 |
|
| 257 | 256 |
int *charmap = c->mc_charmap; |
| 258 | 257 |
uint8_t *colram = c->mc_colram; |
| ... | ... |
@@ -280,7 +279,6 @@ static int a64multi_encode_frame(AVCodecContext *avctx, unsigned char *buf, |
| 280 | 280 |
if (!c->mc_lifetime) return 0; |
| 281 | 281 |
/* no more frames in queue, prepare to flush remaining frames */ |
| 282 | 282 |
if (!c->mc_frame_counter) {
|
| 283 |
- num_frames = c->mc_lifetime; |
|
| 284 | 283 |
c->mc_lifetime = 0; |
| 285 | 284 |
} |
| 286 | 285 |
/* still frames in queue so limit lifetime to remaining frames */ |
| ... | ... |
@@ -311,7 +311,7 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce |
| 311 | 311 |
int win, int group_len, const float lambda) |
| 312 | 312 |
{
|
| 313 | 313 |
BandCodingPath path[120][12]; |
| 314 |
- int w, swb, cb, start, start2, size; |
|
| 314 |
+ int w, swb, cb, start, size; |
|
| 315 | 315 |
int i, j; |
| 316 | 316 |
const int max_sfb = sce->ics.max_sfb; |
| 317 | 317 |
const int run_bits = sce->ics.num_windows == 1 ? 5 : 3; |
| ... | ... |
@@ -329,7 +329,6 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce |
| 329 | 329 |
path[0][cb].run = 0; |
| 330 | 330 |
} |
| 331 | 331 |
for (swb = 0; swb < max_sfb; swb++) {
|
| 332 |
- start2 = start; |
|
| 333 | 332 |
size = sce->ics.swb_sizes[swb]; |
| 334 | 333 |
if (sce->zeroes[win*16 + swb]) {
|
| 335 | 334 |
for (cb = 0; cb < 12; cb++) {
|
| ... | ... |
@@ -413,7 +412,7 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce, |
| 413 | 413 |
int win, int group_len, const float lambda) |
| 414 | 414 |
{
|
| 415 | 415 |
BandCodingPath path[120][12]; |
| 416 |
- int w, swb, cb, start, start2, size; |
|
| 416 |
+ int w, swb, cb, start, size; |
|
| 417 | 417 |
int i, j; |
| 418 | 418 |
const int max_sfb = sce->ics.max_sfb; |
| 419 | 419 |
const int run_bits = sce->ics.num_windows == 1 ? 5 : 3; |
| ... | ... |
@@ -431,7 +430,6 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce, |
| 431 | 431 |
path[0][cb].run = 0; |
| 432 | 432 |
} |
| 433 | 433 |
for (swb = 0; swb < max_sfb; swb++) {
|
| 434 |
- start2 = start; |
|
| 435 | 434 |
size = sce->ics.swb_sizes[swb]; |
| 436 | 435 |
if (sce->zeroes[win*16 + swb]) {
|
| 437 | 436 |
for (cb = 0; cb < 12; cb++) {
|
| ... | ... |
@@ -1006,12 +1004,11 @@ static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s, |
| 1006 | 1006 |
SingleChannelElement *sce, |
| 1007 | 1007 |
const float lambda) |
| 1008 | 1008 |
{
|
| 1009 |
- int start = 0, i, w, w2, g; |
|
| 1009 |
+ int i, w, w2, g; |
|
| 1010 | 1010 |
int minq = 255; |
| 1011 | 1011 |
|
| 1012 | 1012 |
memset(sce->sf_idx, 0, sizeof(sce->sf_idx)); |
| 1013 | 1013 |
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
| 1014 |
- start = w*128; |
|
| 1015 | 1014 |
for (g = 0; g < sce->ics.num_swb; g++) {
|
| 1016 | 1015 |
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
|
| 1017 | 1016 |
FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g]; |
| ... | ... |
@@ -109,7 +109,7 @@ void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs, |
| 109 | 109 |
old_out2 = out[-2]; |
| 110 | 110 |
old_out3 = out[-1]; |
| 111 | 111 |
for (n = 0; n <= buffer_length - 4; n+=4) {
|
| 112 |
- float tmp0,tmp1,tmp2,tmp3; |
|
| 112 |
+ float tmp0,tmp1,tmp2; |
|
| 113 | 113 |
float val; |
| 114 | 114 |
|
| 115 | 115 |
out0 = in[0]; |
| ... | ... |
@@ -160,7 +160,6 @@ void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs, |
| 160 | 160 |
tmp0 = out0; |
| 161 | 161 |
tmp1 = out1; |
| 162 | 162 |
tmp2 = out2; |
| 163 |
- tmp3 = out3; |
|
| 164 | 163 |
|
| 165 | 164 |
out3 -= a * tmp2; |
| 166 | 165 |
out2 -= a * tmp1; |
| ... | ... |
@@ -1535,8 +1535,6 @@ static void dca_exss_parse_header(DCAContext *s) |
| 1535 | 1535 |
{
|
| 1536 | 1536 |
int ss_index; |
| 1537 | 1537 |
int blownup; |
| 1538 |
- int header_size; |
|
| 1539 |
- int hd_size; |
|
| 1540 | 1538 |
int num_audiop = 1; |
| 1541 | 1539 |
int num_assets = 1; |
| 1542 | 1540 |
int active_ss_mask[8]; |
| ... | ... |
@@ -1549,8 +1547,8 @@ static void dca_exss_parse_header(DCAContext *s) |
| 1549 | 1549 |
ss_index = get_bits(&s->gb, 2); |
| 1550 | 1550 |
|
| 1551 | 1551 |
blownup = get_bits1(&s->gb); |
| 1552 |
- header_size = get_bits(&s->gb, 8 + 4 * blownup) + 1; |
|
| 1553 |
- hd_size = get_bits_long(&s->gb, 16 + 4 * blownup) + 1; |
|
| 1552 |
+ skip_bits(&s->gb, 8 + 4 * blownup); // header_size |
|
| 1553 |
+ skip_bits(&s->gb, 16 + 4 * blownup); // hd_size |
|
| 1554 | 1554 |
|
| 1555 | 1555 |
s->static_fields = get_bits1(&s->gb); |
| 1556 | 1556 |
if (s->static_fields) {
|
| ... | ... |
@@ -245,11 +245,11 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb, |
| 245 | 245 |
int ff_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb, |
| 246 | 246 |
dirac_source_params *source) |
| 247 | 247 |
{
|
| 248 |
- unsigned version_major, version_minor; |
|
| 248 |
+ unsigned version_major; |
|
| 249 | 249 |
unsigned video_format, picture_coding_mode; |
| 250 | 250 |
|
| 251 | 251 |
version_major = svq3_get_ue_golomb(gb); |
| 252 |
- version_minor = svq3_get_ue_golomb(gb); |
|
| 252 |
+ svq3_get_ue_golomb(gb); /* version_minor */ |
|
| 253 | 253 |
avctx->profile = svq3_get_ue_golomb(gb); |
| 254 | 254 |
avctx->level = svq3_get_ue_golomb(gb); |
| 255 | 255 |
video_format = svq3_get_ue_golomb(gb); |
| ... | ... |
@@ -152,7 +152,7 @@ int ff_h263_decode_mba(MpegEncContext *s) |
| 152 | 152 |
*/ |
| 153 | 153 |
static int h263_decode_gob_header(MpegEncContext *s) |
| 154 | 154 |
{
|
| 155 |
- unsigned int val, gfid, gob_number; |
|
| 155 |
+ unsigned int val, gob_number; |
|
| 156 | 156 |
int left; |
| 157 | 157 |
|
| 158 | 158 |
/* Check for GOB Start Code */ |
| ... | ... |
@@ -183,12 +183,12 @@ static int h263_decode_gob_header(MpegEncContext *s) |
| 183 | 183 |
s->qscale = get_bits(&s->gb, 5); /* SQUANT */ |
| 184 | 184 |
if(get_bits1(&s->gb)==0) |
| 185 | 185 |
return -1; |
| 186 |
- gfid = get_bits(&s->gb, 2); /* GFID */ |
|
| 186 |
+ skip_bits(&s->gb, 2); /* GFID */ |
|
| 187 | 187 |
}else{
|
| 188 | 188 |
gob_number = get_bits(&s->gb, 5); /* GN */ |
| 189 | 189 |
s->mb_x= 0; |
| 190 | 190 |
s->mb_y= s->gob_index* gob_number; |
| 191 |
- gfid = get_bits(&s->gb, 2); /* GFID */ |
|
| 191 |
+ skip_bits(&s->gb, 2); /* GFID */ |
|
| 192 | 192 |
s->qscale = get_bits(&s->gb, 5); /* GQUANT */ |
| 193 | 193 |
} |
| 194 | 194 |
|
| ... | ... |
@@ -2128,14 +2128,13 @@ static void mpeg_decode_gop(AVCodecContext *avctx, |
| 2128 | 2128 |
Mpeg1Context *s1 = avctx->priv_data; |
| 2129 | 2129 |
MpegEncContext *s = &s1->mpeg_enc_ctx; |
| 2130 | 2130 |
|
| 2131 |
- int drop_frame_flag; |
|
| 2132 | 2131 |
int time_code_hours, time_code_minutes; |
| 2133 | 2132 |
int time_code_seconds, time_code_pictures; |
| 2134 | 2133 |
int broken_link; |
| 2135 | 2134 |
|
| 2136 | 2135 |
init_get_bits(&s->gb, buf, buf_size*8); |
| 2137 | 2136 |
|
| 2138 |
- drop_frame_flag = get_bits1(&s->gb); |
|
| 2137 |
+ skip_bits1(&s->gb); /* drop_frame_flag */ |
|
| 2139 | 2138 |
|
| 2140 | 2139 |
time_code_hours=get_bits(&s->gb,5); |
| 2141 | 2140 |
time_code_minutes = get_bits(&s->gb,6); |
| ... | ... |
@@ -761,10 +761,9 @@ void ff_mpeg1_encode_init(MpegEncContext *s) |
| 761 | 761 |
|
| 762 | 762 |
if(mv==0) len= ff_mpeg12_mbMotionVectorTable[0][1]; |
| 763 | 763 |
else{
|
| 764 |
- int val, bit_size, range, code; |
|
| 764 |
+ int val, bit_size, code; |
|
| 765 | 765 |
|
| 766 | 766 |
bit_size = f_code - 1; |
| 767 |
- range = 1 << bit_size; |
|
| 768 | 767 |
|
| 769 | 768 |
val=mv; |
| 770 | 769 |
if (val < 0) |
| ... | ... |
@@ -397,14 +397,13 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s) |
| 397 | 397 |
header_extension= get_bits1(&s->gb); |
| 398 | 398 |
} |
| 399 | 399 |
if(header_extension){
|
| 400 |
- int time_increment; |
|
| 401 | 400 |
int time_incr=0; |
| 402 | 401 |
|
| 403 | 402 |
while (get_bits1(&s->gb) != 0) |
| 404 | 403 |
time_incr++; |
| 405 | 404 |
|
| 406 | 405 |
check_marker(&s->gb, "before time_increment in video packed header"); |
| 407 |
- time_increment= get_bits(&s->gb, s->time_increment_bits); |
|
| 406 |
+ skip_bits(&s->gb, s->time_increment_bits); /* time_increment */ |
|
| 408 | 407 |
check_marker(&s->gb, "before vop_coding_type in video packed header"); |
| 409 | 408 |
|
| 410 | 409 |
skip_bits(&s->gb, 2); /* vop coding type */ |
| ... | ... |
@@ -1801,16 +1800,14 @@ no_cplx_est: |
| 1801 | 1801 |
|
| 1802 | 1802 |
if (s->scalability) {
|
| 1803 | 1803 |
GetBitContext bak= *gb; |
| 1804 |
- int ref_layer_id; |
|
| 1805 |
- int ref_layer_sampling_dir; |
|
| 1806 | 1804 |
int h_sampling_factor_n; |
| 1807 | 1805 |
int h_sampling_factor_m; |
| 1808 | 1806 |
int v_sampling_factor_n; |
| 1809 | 1807 |
int v_sampling_factor_m; |
| 1810 | 1808 |
|
| 1811 | 1809 |
s->hierachy_type= get_bits1(gb); |
| 1812 |
- ref_layer_id= get_bits(gb, 4); |
|
| 1813 |
- ref_layer_sampling_dir= get_bits1(gb); |
|
| 1810 |
+ skip_bits(gb, 4); /* ref_layer_id */ |
|
| 1811 |
+ skip_bits1(gb); /* ref_layer_sampling_dir */ |
|
| 1814 | 1812 |
h_sampling_factor_n= get_bits(gb, 5); |
| 1815 | 1813 |
h_sampling_factor_m= get_bits(gb, 5); |
| 1816 | 1814 |
v_sampling_factor_n= get_bits(gb, 5); |
| ... | ... |
@@ -1989,15 +1986,13 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
|
| 1989 | 1989 |
|
| 1990 | 1990 |
if (s->shape != RECT_SHAPE) {
|
| 1991 | 1991 |
if (s->vol_sprite_usage != 1 || s->pict_type != AV_PICTURE_TYPE_I) {
|
| 1992 |
- int width, height, hor_spat_ref, ver_spat_ref; |
|
| 1993 |
- |
|
| 1994 |
- width = get_bits(gb, 13); |
|
| 1992 |
+ skip_bits(gb, 13); /* width */ |
|
| 1995 | 1993 |
skip_bits1(gb); /* marker */ |
| 1996 |
- height = get_bits(gb, 13); |
|
| 1994 |
+ skip_bits(gb, 13); /* height */ |
|
| 1997 | 1995 |
skip_bits1(gb); /* marker */ |
| 1998 |
- hor_spat_ref = get_bits(gb, 13); /* hor_spat_ref */ |
|
| 1996 |
+ skip_bits(gb, 13); /* hor_spat_ref */ |
|
| 1999 | 1997 |
skip_bits1(gb); /* marker */ |
| 2000 |
- ver_spat_ref = get_bits(gb, 13); /* ver_spat_ref */ |
|
| 1998 |
+ skip_bits(gb, 13); /* ver_spat_ref */ |
|
| 2001 | 1999 |
} |
| 2002 | 2000 |
skip_bits1(gb); /* change_CR_disable */ |
| 2003 | 2001 |
|
| ... | ... |
@@ -32,7 +32,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, |
| 32 | 32 |
uint32_t start_code; |
| 33 | 33 |
int frame_rate_index, ext_type, bytes_left; |
| 34 | 34 |
int frame_rate_ext_n, frame_rate_ext_d; |
| 35 |
- int picture_structure, top_field_first, repeat_first_field, progressive_frame; |
|
| 35 |
+ int top_field_first, repeat_first_field, progressive_frame; |
|
| 36 | 36 |
int horiz_size_ext, vert_size_ext, bit_rate_ext; |
| 37 | 37 |
int did_set_size=0; |
| 38 | 38 |
//FIXME replace the crap with get_bits() |
| ... | ... |
@@ -91,7 +91,6 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, |
| 91 | 91 |
break; |
| 92 | 92 |
case 0x8: /* picture coding extension */ |
| 93 | 93 |
if (bytes_left >= 5) {
|
| 94 |
- picture_structure = buf[2]&3; |
|
| 95 | 94 |
top_field_first = buf[3] & (1 << 7); |
| 96 | 95 |
repeat_first_field = buf[3] & (1 << 1); |
| 97 | 96 |
progressive_frame = buf[4] & (1 << 7); |
| ... | ... |
@@ -1528,9 +1528,7 @@ int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size) |
| 1528 | 1528 |
/* the alt_bitstream reader could read over the end so we need to check it */ |
| 1529 | 1529 |
if(left>=length && left<length+8) |
| 1530 | 1530 |
{
|
| 1531 |
- int fps; |
|
| 1532 |
- |
|
| 1533 |
- fps= get_bits(&s->gb, 5); |
|
| 1531 |
+ skip_bits(&s->gb, 5); /* fps */ |
|
| 1534 | 1532 |
s->bit_rate= get_bits(&s->gb, 11)*1024; |
| 1535 | 1533 |
if(s->msmpeg4_version>=3) |
| 1536 | 1534 |
s->flipflop_rounding= get_bits1(&s->gb); |
| ... | ... |
@@ -397,7 +397,7 @@ static int decode_frame(AVCodecContext *avctx, |
| 397 | 397 |
AVFrame *p; |
| 398 | 398 |
uint8_t *crow_buf_base = NULL; |
| 399 | 399 |
uint32_t tag, length; |
| 400 |
- int ret, crc; |
|
| 400 |
+ int ret; |
|
| 401 | 401 |
|
| 402 | 402 |
FFSWAP(AVFrame *, s->current_picture, s->last_picture); |
| 403 | 403 |
avctx->coded_frame= s->current_picture; |
| ... | ... |
@@ -451,7 +451,7 @@ static int decode_frame(AVCodecContext *avctx, |
| 451 | 451 |
s->compression_type = *s->bytestream++; |
| 452 | 452 |
s->filter_type = *s->bytestream++; |
| 453 | 453 |
s->interlace_type = *s->bytestream++; |
| 454 |
- crc = bytestream_get_be32(&s->bytestream); |
|
| 454 |
+ s->bytestream += 4; /* crc */ |
|
| 455 | 455 |
s->state |= PNG_IHDR; |
| 456 | 456 |
av_dlog(avctx, "width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n", |
| 457 | 457 |
s->width, s->height, s->bit_depth, s->color_type, |
| ... | ... |
@@ -547,8 +547,7 @@ static int decode_frame(AVCodecContext *avctx, |
| 547 | 547 |
s->state |= PNG_IDAT; |
| 548 | 548 |
if (png_decode_idat(s, length) < 0) |
| 549 | 549 |
goto fail; |
| 550 |
- /* skip crc */ |
|
| 551 |
- crc = bytestream_get_be32(&s->bytestream); |
|
| 550 |
+ s->bytestream += 4; /* crc */ |
|
| 552 | 551 |
break; |
| 553 | 552 |
case MKTAG('P', 'L', 'T', 'E'):
|
| 554 | 553 |
{
|
| ... | ... |
@@ -568,7 +567,7 @@ static int decode_frame(AVCodecContext *avctx, |
| 568 | 568 |
s->palette[i] = (0xff << 24); |
| 569 | 569 |
} |
| 570 | 570 |
s->state |= PNG_PLTE; |
| 571 |
- crc = bytestream_get_be32(&s->bytestream); |
|
| 571 |
+ s->bytestream += 4; /* crc */ |
|
| 572 | 572 |
} |
| 573 | 573 |
break; |
| 574 | 574 |
case MKTAG('t', 'R', 'N', 'S'):
|
| ... | ... |
@@ -584,13 +583,13 @@ static int decode_frame(AVCodecContext *avctx, |
| 584 | 584 |
v = *s->bytestream++; |
| 585 | 585 |
s->palette[i] = (s->palette[i] & 0x00ffffff) | (v << 24); |
| 586 | 586 |
} |
| 587 |
- crc = bytestream_get_be32(&s->bytestream); |
|
| 587 |
+ s->bytestream += 4; /* crc */ |
|
| 588 | 588 |
} |
| 589 | 589 |
break; |
| 590 | 590 |
case MKTAG('I', 'E', 'N', 'D'):
|
| 591 | 591 |
if (!(s->state & PNG_ALLIMAGE)) |
| 592 | 592 |
goto fail; |
| 593 |
- crc = bytestream_get_be32(&s->bytestream); |
|
| 593 |
+ s->bytestream += 4; /* crc */ |
|
| 594 | 594 |
goto exit_loop; |
| 595 | 595 |
default: |
| 596 | 596 |
/* skip tag */ |
| ... | ... |
@@ -235,7 +235,7 @@ int rv_decode_dc(MpegEncContext *s, int n) |
| 235 | 235 |
/* read RV 1.0 compatible frame header */ |
| 236 | 236 |
static int rv10_decode_picture_header(MpegEncContext *s) |
| 237 | 237 |
{
|
| 238 |
- int mb_count, pb_frame, marker, unk, mb_xy; |
|
| 238 |
+ int mb_count, pb_frame, marker, mb_xy; |
|
| 239 | 239 |
|
| 240 | 240 |
marker = get_bits1(&s->gb); |
| 241 | 241 |
|
| ... | ... |
@@ -282,7 +282,7 @@ static int rv10_decode_picture_header(MpegEncContext *s) |
| 282 | 282 |
s->mb_y = 0; |
| 283 | 283 |
mb_count = s->mb_width * s->mb_height; |
| 284 | 284 |
} |
| 285 |
- unk= get_bits(&s->gb, 3); /* ignored */ |
|
| 285 |
+ skip_bits(&s->gb, 3); /* ignored */ |
|
| 286 | 286 |
s->f_code = 1; |
| 287 | 287 |
s->unrestricted_mv = 1; |
| 288 | 288 |
|
| ... | ... |
@@ -29,7 +29,7 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf, |
| 29 | 29 |
int buf_size) |
| 30 | 30 |
{
|
| 31 | 31 |
uint32_t h; |
| 32 |
- int frame_size, channels, id, bits; |
|
| 32 |
+ int frame_size, channels, bits; |
|
| 33 | 33 |
|
| 34 | 34 |
if (buf_size <= AES3_HEADER_LEN) {
|
| 35 | 35 |
av_log(avctx, AV_LOG_ERROR, "frame is too short\n"); |
| ... | ... |
@@ -48,7 +48,6 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf, |
| 48 | 48 |
h = AV_RB32(buf); |
| 49 | 49 |
frame_size = (h >> 16) & 0xffff; |
| 50 | 50 |
channels = ((h >> 14) & 0x0003) * 2 + 2; |
| 51 |
- id = (h >> 6) & 0x00ff; |
|
| 52 | 51 |
bits = ((h >> 4) & 0x0003) * 4 + 16; |
| 53 | 52 |
|
| 54 | 53 |
if (AES3_HEADER_LEN + frame_size != buf_size || bits > 24) {
|
| ... | ... |
@@ -196,7 +196,6 @@ static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header |
| 196 | 196 |
{
|
| 197 | 197 |
GetBitContext hb; |
| 198 | 198 |
int len; |
| 199 |
- int chunk_size; |
|
| 200 | 199 |
short wave_format; |
| 201 | 200 |
|
| 202 | 201 |
init_get_bits(&hb, header, header_size*8); |
| ... | ... |
@@ -205,7 +204,7 @@ static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header |
| 205 | 205 |
return -1; |
| 206 | 206 |
} |
| 207 | 207 |
|
| 208 |
- chunk_size = get_le32(&hb); |
|
| 208 |
+ skip_bits_long(&hb, 32); /* chunk_size */ |
|
| 209 | 209 |
|
| 210 | 210 |
if (get_le32(&hb) != MKTAG('W','A','V','E')) {
|
| 211 | 211 |
av_log(avctx, AV_LOG_ERROR, "missing WAVE tag\n"); |
| ... | ... |
@@ -38,15 +38,12 @@ static int sp5x_decode_frame(AVCodecContext *avctx, |
| 38 | 38 |
int buf_size = avpkt->size; |
| 39 | 39 |
AVPacket avpkt_recoded; |
| 40 | 40 |
const int qscale = 5; |
| 41 |
- const uint8_t *buf_ptr; |
|
| 42 | 41 |
uint8_t *recoded; |
| 43 | 42 |
int i = 0, j = 0; |
| 44 | 43 |
|
| 45 | 44 |
if (!avctx->width || !avctx->height) |
| 46 | 45 |
return -1; |
| 47 | 46 |
|
| 48 |
- buf_ptr = buf; |
|
| 49 |
- |
|
| 50 | 47 |
recoded = av_mallocz(buf_size + 1024); |
| 51 | 48 |
if (!recoded) |
| 52 | 49 |
return -1; |
| ... | ... |
@@ -554,9 +554,8 @@ static void svq1_parse_string (GetBitContext *bitbuf, uint8_t *out) {
|
| 554 | 554 |
|
| 555 | 555 |
static int svq1_decode_frame_header (GetBitContext *bitbuf,MpegEncContext *s) {
|
| 556 | 556 |
int frame_size_code; |
| 557 |
- int temporal_reference; |
|
| 558 | 557 |
|
| 559 |
- temporal_reference = get_bits (bitbuf, 8); |
|
| 558 |
+ skip_bits(bitbuf, 8); /* temporal_reference */ |
|
| 560 | 559 |
|
| 561 | 560 |
/* frame type */ |
| 562 | 561 |
s->pict_type= get_bits (bitbuf, 2)+1; |
| ... | ... |
@@ -108,18 +108,18 @@ static int decode_frame(AVCodecContext *avctx, |
| 108 | 108 |
AVFrame * const p= (AVFrame*)&s->picture; |
| 109 | 109 |
uint8_t *dst; |
| 110 | 110 |
int stride; |
| 111 |
- int idlen, pal, compr, x, y, w, h, bpp, flags; |
|
| 111 |
+ int idlen, compr, y, w, h, bpp, flags; |
|
| 112 | 112 |
int first_clr, colors, csize; |
| 113 | 113 |
|
| 114 | 114 |
/* parse image header */ |
| 115 | 115 |
CHECK_BUFFER_SIZE(buf, buf_end, 18, "header"); |
| 116 | 116 |
idlen = *buf++; |
| 117 |
- pal = *buf++; |
|
| 117 |
+ buf++; /* pal */ |
|
| 118 | 118 |
compr = *buf++; |
| 119 | 119 |
first_clr = AV_RL16(buf); buf += 2; |
| 120 | 120 |
colors = AV_RL16(buf); buf += 2; |
| 121 | 121 |
csize = *buf++; |
| 122 |
- x = AV_RL16(buf); buf += 2; |
|
| 122 |
+ buf += 2; /* x */ |
|
| 123 | 123 |
y = AV_RL16(buf); buf += 2; |
| 124 | 124 |
w = AV_RL16(buf); buf += 2; |
| 125 | 125 |
h = AV_RL16(buf); buf += 2; |
| ... | ... |
@@ -201,7 +201,6 @@ static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf) |
| 201 | 201 |
{
|
| 202 | 202 |
uint32_t magic; |
| 203 | 203 |
const uint8_t *obuf; |
| 204 |
- int length; |
|
| 205 | 204 |
|
| 206 | 205 |
obuf = buf; |
| 207 | 206 |
|
| ... | ... |
@@ -212,19 +211,6 @@ static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf) |
| 212 | 212 |
/* av_log (ctx->avctx, AV_LOG_ERROR, "TM2 old header: not implemented (yet)\n"); */ |
| 213 | 213 |
return 40; |
| 214 | 214 |
} else if(magic == 0x00000101) { /* new header */
|
| 215 |
- int w, h, size, flags, xr, yr; |
|
| 216 |
- |
|
| 217 |
- length = AV_RL32(buf); |
|
| 218 |
- buf += 4; |
|
| 219 |
- |
|
| 220 |
- init_get_bits(&ctx->gb, buf, 32 * 8); |
|
| 221 |
- size = get_bits_long(&ctx->gb, 31); |
|
| 222 |
- h = get_bits(&ctx->gb, 15); |
|
| 223 |
- w = get_bits(&ctx->gb, 15); |
|
| 224 |
- flags = get_bits_long(&ctx->gb, 31); |
|
| 225 |
- yr = get_bits(&ctx->gb, 9); |
|
| 226 |
- xr = get_bits(&ctx->gb, 9); |
|
| 227 |
- |
|
| 228 | 215 |
return 40; |
| 229 | 216 |
} else {
|
| 230 | 217 |
av_log (ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic); |
| ... | ... |
@@ -75,7 +75,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac |
| 75 | 75 |
int buf_size = avpkt->size; |
| 76 | 76 |
CamtasiaContext * const c = avctx->priv_data; |
| 77 | 77 |
const unsigned char *encoded = buf; |
| 78 |
- unsigned char *outptr; |
|
| 79 | 78 |
int zret; // Zlib return code |
| 80 | 79 |
int len = buf_size; |
| 81 | 80 |
|
| ... | ... |
@@ -89,8 +88,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac |
| 89 | 89 |
return -1; |
| 90 | 90 |
} |
| 91 | 91 |
|
| 92 |
- outptr = c->pic.data[0]; // Output image pointer |
|
| 93 |
- |
|
| 94 | 92 |
zret = inflateReset(&(c->zstream)); |
| 95 | 93 |
if (zret != Z_OK) {
|
| 96 | 94 |
av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret); |
| ... | ... |
@@ -199,7 +199,6 @@ static void vmd_decode(VmdVideoContext *s) |
| 199 | 199 |
|
| 200 | 200 |
int frame_x, frame_y; |
| 201 | 201 |
int frame_width, frame_height; |
| 202 |
- int dp_size; |
|
| 203 | 202 |
|
| 204 | 203 |
frame_x = AV_RL16(&s->buf[6]); |
| 205 | 204 |
frame_y = AV_RL16(&s->buf[8]); |
| ... | ... |
@@ -247,7 +246,6 @@ static void vmd_decode(VmdVideoContext *s) |
| 247 | 247 |
} |
| 248 | 248 |
|
| 249 | 249 |
dp = &s->frame.data[0][frame_y * s->frame.linesize[0] + frame_x]; |
| 250 |
- dp_size = s->frame.linesize[0] * s->avctx->height; |
|
| 251 | 250 |
pp = &s->prev_frame.data[0][frame_y * s->prev_frame.linesize[0] + frame_x]; |
| 252 | 251 |
switch (meth) {
|
| 253 | 252 |
case 1: |
| ... | ... |
@@ -181,7 +181,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, void |
| 181 | 181 |
int x, y, bh2, bw2, xored; |
| 182 | 182 |
uint8_t *tsrc, *tprev; |
| 183 | 183 |
uint8_t *mv; |
| 184 |
- int mx, my, bv; |
|
| 184 |
+ int mx, my; |
|
| 185 | 185 |
|
| 186 | 186 |
bw = (avctx->width + ZMBV_BLOCK - 1) / ZMBV_BLOCK; |
| 187 | 187 |
bh = (avctx->height + ZMBV_BLOCK - 1) / ZMBV_BLOCK; |
| ... | ... |
@@ -197,7 +197,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, void |
| 197 | 197 |
tsrc = src + x; |
| 198 | 198 |
tprev = prev + x; |
| 199 | 199 |
|
| 200 |
- bv = zmbv_me(c, tsrc, p->linesize[0], tprev, c->pstride, x, y, &mx, &my, &xored); |
|
| 200 |
+ zmbv_me(c, tsrc, p->linesize[0], tprev, c->pstride, x, y, &mx, &my, &xored); |
|
| 201 | 201 |
mv[0] = (mx << 1) | !!xored; |
| 202 | 202 |
mv[1] = my << 1; |
| 203 | 203 |
tprev += mx + my * c->pstride; |
| ... | ... |
@@ -153,7 +153,7 @@ static void end_frame(AVFilterLink *inlink) |
| 153 | 153 |
AVFilterBufferRef *inpicref = inlink->cur_buf; |
| 154 | 154 |
AVFilterBufferRef *outpicref = outlink->out_buf; |
| 155 | 155 |
|
| 156 |
- int h, w, plane, line_step, line_size, line; |
|
| 156 |
+ int h, plane, line_step, line_size, line; |
|
| 157 | 157 |
uint8_t *cpy_src, *cpy_dst; |
| 158 | 158 |
|
| 159 | 159 |
if ( inpicref->video->interlaced |
| ... | ... |
@@ -162,7 +162,6 @@ static void end_frame(AVFilterLink *inlink) |
| 162 | 162 |
"picture will move %s one line\n", |
| 163 | 163 |
fieldorder->dst_tff ? "up" : "down"); |
| 164 | 164 |
h = inpicref->video->h; |
| 165 |
- w = inpicref->video->w; |
|
| 166 | 165 |
for (plane = 0; plane < 4 && inpicref->data[plane]; plane++) {
|
| 167 | 166 |
line_step = inpicref->linesize[plane]; |
| 168 | 167 |
line_size = fieldorder->line_size[plane]; |
| ... | ... |
@@ -246,7 +246,7 @@ static int fourxm_read_packet(AVFormatContext *s, |
| 246 | 246 |
FourxmDemuxContext *fourxm = s->priv_data; |
| 247 | 247 |
AVIOContext *pb = s->pb; |
| 248 | 248 |
unsigned int fourcc_tag; |
| 249 |
- unsigned int size, out_size; |
|
| 249 |
+ unsigned int size; |
|
| 250 | 250 |
int ret = 0; |
| 251 | 251 |
unsigned int track_number; |
| 252 | 252 |
int packet_read = 0; |
| ... | ... |
@@ -295,7 +295,7 @@ static int fourxm_read_packet(AVFormatContext *s, |
| 295 | 295 |
|
| 296 | 296 |
case snd__TAG: |
| 297 | 297 |
track_number = avio_rl32(pb); |
| 298 |
- out_size= avio_rl32(pb); |
|
| 298 |
+ avio_skip(pb, 4); |
|
| 299 | 299 |
size-=8; |
| 300 | 300 |
|
| 301 | 301 |
if (track_number < fourxm->track_count && fourxm->tracks[track_number].channels>0) {
|
| ... | ... |
@@ -35,11 +35,11 @@ static int ape_tag_read_field(AVFormatContext *s) |
| 35 | 35 |
{
|
| 36 | 36 |
AVIOContext *pb = s->pb; |
| 37 | 37 |
uint8_t key[1024], *value; |
| 38 |
- uint32_t size, flags; |
|
| 38 |
+ uint32_t size; |
|
| 39 | 39 |
int i, c; |
| 40 | 40 |
|
| 41 | 41 |
size = avio_rl32(pb); /* field size */ |
| 42 |
- flags = avio_rl32(pb); /* field flags */ |
|
| 42 |
+ avio_skip(pb, 4); /* field flags */ |
|
| 43 | 43 |
for (i = 0; i < sizeof(key) - 1; i++) {
|
| 44 | 44 |
c = avio_r8(pb); |
| 45 | 45 |
if (c < 0x20 || c > 0x7E) |
| ... | ... |
@@ -216,7 +216,6 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) |
| 216 | 216 |
ff_asf_guid g; |
| 217 | 217 |
enum AVMediaType type; |
| 218 | 218 |
int type_specific_size, sizeX; |
| 219 |
- uint64_t total_size; |
|
| 220 | 219 |
unsigned int tag1; |
| 221 | 220 |
int64_t pos1, pos2, start_time; |
| 222 | 221 |
int test_for_ext_stream_audio, is_dvr_ms_audio=0; |
| ... | ... |
@@ -264,7 +263,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) |
| 264 | 264 |
return -1; |
| 265 | 265 |
} |
| 266 | 266 |
ff_get_guid(pb, &g); |
| 267 |
- total_size = avio_rl64(pb); |
|
| 267 |
+ avio_skip(pb, 8); /* total_size */ |
|
| 268 | 268 |
type_specific_size = avio_rl32(pb); |
| 269 | 269 |
avio_rl32(pb); |
| 270 | 270 |
st->id = avio_rl16(pb) & 0x7f; /* stream id */ |
| ... | ... |
@@ -401,7 +400,7 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size) |
| 401 | 401 |
AVIOContext *pb = s->pb; |
| 402 | 402 |
ff_asf_guid g; |
| 403 | 403 |
int ext_len, payload_ext_ct, stream_ct, i; |
| 404 |
- uint32_t ext_d, leak_rate, stream_num; |
|
| 404 |
+ uint32_t leak_rate, stream_num; |
|
| 405 | 405 |
unsigned int stream_languageid_index; |
| 406 | 406 |
|
| 407 | 407 |
avio_rl64(pb); // starttime |
| ... | ... |
@@ -435,7 +434,7 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size) |
| 435 | 435 |
|
| 436 | 436 |
for (i=0; i<payload_ext_ct; i++){
|
| 437 | 437 |
ff_get_guid(pb, &g); |
| 438 |
- ext_d=avio_rl16(pb); |
|
| 438 |
+ avio_skip(pb, 2); |
|
| 439 | 439 |
ext_len=avio_rl32(pb); |
| 440 | 440 |
avio_skip(pb, ext_len); |
| 441 | 441 |
} |
| ... | ... |
@@ -519,7 +518,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size) |
| 519 | 519 |
{
|
| 520 | 520 |
AVIOContext *pb = s->pb; |
| 521 | 521 |
ASFContext *asf = s->priv_data; |
| 522 |
- int n, stream_num, name_len, value_len, value_type, value_num; |
|
| 522 |
+ int n, stream_num, name_len, value_len, value_num; |
|
| 523 | 523 |
int ret, i; |
| 524 | 524 |
n = avio_rl16(pb); |
| 525 | 525 |
|
| ... | ... |
@@ -529,7 +528,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size) |
| 529 | 529 |
avio_rl16(pb); //lang_list_index |
| 530 | 530 |
stream_num= avio_rl16(pb); |
| 531 | 531 |
name_len= avio_rl16(pb); |
| 532 |
- value_type= avio_rl16(pb); |
|
| 532 |
+ avio_skip(pb, 2); /* value_type */ |
|
| 533 | 533 |
value_len= avio_rl32(pb); |
| 534 | 534 |
|
| 535 | 535 |
if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len) |
| ... | ... |
@@ -634,10 +633,8 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 634 | 634 |
// if so the next iteration will pick it up |
| 635 | 635 |
continue; |
| 636 | 636 |
} else if (!ff_guidcmp(&g, &ff_asf_head1_guid)) {
|
| 637 |
- int v1, v2; |
|
| 638 | 637 |
ff_get_guid(pb, &g); |
| 639 |
- v1 = avio_rl32(pb); |
|
| 640 |
- v2 = avio_rl16(pb); |
|
| 638 |
+ avio_skip(pb, 6); |
|
| 641 | 639 |
continue; |
| 642 | 640 |
} else if (!ff_guidcmp(&g, &ff_asf_marker_header)) {
|
| 643 | 641 |
asf_read_marker(s, gsize); |
| ... | ... |
@@ -807,7 +804,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
|
| 807 | 807 |
ASFContext *asf = s->priv_data; |
| 808 | 808 |
int rsize = 1; |
| 809 | 809 |
int num = avio_r8(pb); |
| 810 |
- int64_t ts0, ts1; |
|
| 810 |
+ int64_t ts0; |
|
| 811 | 811 |
|
| 812 | 812 |
asf->packet_segments--; |
| 813 | 813 |
asf->packet_key_frame = num >> 7; |
| ... | ... |
@@ -830,7 +827,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
|
| 830 | 830 |
// av_log(s, AV_LOG_DEBUG, "\n"); |
| 831 | 831 |
avio_skip(pb, 10); |
| 832 | 832 |
ts0= avio_rl64(pb); |
| 833 |
- ts1= avio_rl64(pb); |
|
| 833 |
+ avio_skip(pb, 8);; |
|
| 834 | 834 |
avio_skip(pb, 12); |
| 835 | 835 |
avio_rl32(pb); |
| 836 | 836 |
avio_skip(pb, asf->packet_replic_size - 8 - 38 - 4); |
| ... | ... |
@@ -337,7 +337,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 337 | 337 |
AVIContext *avi = s->priv_data; |
| 338 | 338 |
AVIOContext *pb = s->pb; |
| 339 | 339 |
unsigned int tag, tag1, handler; |
| 340 |
- int codec_type, stream_index, frame_period, bit_rate; |
|
| 340 |
+ int codec_type, stream_index, frame_period; |
|
| 341 | 341 |
unsigned int size; |
| 342 | 342 |
int i; |
| 343 | 343 |
AVStream *st; |
| ... | ... |
@@ -407,7 +407,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 407 | 407 |
/* AVI header */ |
| 408 | 408 |
/* using frame_period is bad idea */ |
| 409 | 409 |
frame_period = avio_rl32(pb); |
| 410 |
- bit_rate = avio_rl32(pb) * 8; |
|
| 410 |
+ avio_skip(pb, 4); |
|
| 411 | 411 |
avio_rl32(pb); |
| 412 | 412 |
avi->non_interleaved |= avio_rl32(pb) & AVIF_MUSTUSEINDEX; |
| 413 | 413 |
|
| ... | ... |
@@ -295,9 +295,7 @@ static int gif_write_video(AVFormatContext *s, |
| 295 | 295 |
AVCodecContext *enc, const uint8_t *buf, int size) |
| 296 | 296 |
{
|
| 297 | 297 |
AVIOContext *pb = s->pb; |
| 298 |
- GIFContext *gif = s->priv_data; |
|
| 299 | 298 |
int jiffies; |
| 300 |
- int64_t delay; |
|
| 301 | 299 |
|
| 302 | 300 |
/* graphic control extension block */ |
| 303 | 301 |
avio_w8(pb, 0x21); |
| ... | ... |
@@ -307,8 +305,6 @@ static int gif_write_video(AVFormatContext *s, |
| 307 | 307 |
|
| 308 | 308 |
/* 1 jiffy is 1/70 s */ |
| 309 | 309 |
/* the delay_time field indicates the number of jiffies - 1 */ |
| 310 |
- delay = gif->file_time - gif->time; |
|
| 311 |
- |
|
| 312 | 310 |
/* XXX: should use delay, in order to be more accurate */ |
| 313 | 311 |
/* instead of using the same rounded value each time */ |
| 314 | 312 |
/* XXX: don't even remember if I really use it for now */ |
| ... | ... |
@@ -186,13 +186,13 @@ static int mmf_read_header(AVFormatContext *s, |
| 186 | 186 |
unsigned int tag; |
| 187 | 187 |
AVIOContext *pb = s->pb; |
| 188 | 188 |
AVStream *st; |
| 189 |
- int64_t file_size, size; |
|
| 189 |
+ int64_t size; |
|
| 190 | 190 |
int rate, params; |
| 191 | 191 |
|
| 192 | 192 |
tag = avio_rl32(pb); |
| 193 | 193 |
if (tag != MKTAG('M', 'M', 'M', 'D'))
|
| 194 | 194 |
return -1; |
| 195 |
- file_size = avio_rb32(pb); |
|
| 195 |
+ avio_skip(pb, 4); /* file_size */ |
|
| 196 | 196 |
|
| 197 | 197 |
/* Skip some unused chunks that may or may not be present */ |
| 198 | 198 |
for(;; avio_skip(pb, size)) {
|
| ... | ... |
@@ -263,12 +263,10 @@ static int mmf_read_packet(AVFormatContext *s, |
| 263 | 263 |
AVPacket *pkt) |
| 264 | 264 |
{
|
| 265 | 265 |
MMFContext *mmf = s->priv_data; |
| 266 |
- AVStream *st; |
|
| 267 | 266 |
int ret, size; |
| 268 | 267 |
|
| 269 | 268 |
if (s->pb->eof_reached) |
| 270 | 269 |
return AVERROR(EIO); |
| 271 |
- st = s->streams[0]; |
|
| 272 | 270 |
|
| 273 | 271 |
size = MAX_SIZE; |
| 274 | 272 |
if(size > mmf->data_size) |
| ... | ... |
@@ -464,21 +464,21 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom) |
| 464 | 464 |
int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom) |
| 465 | 465 |
{
|
| 466 | 466 |
AVStream *st; |
| 467 |
- int tag, len; |
|
| 467 |
+ int tag; |
|
| 468 | 468 |
|
| 469 | 469 |
if (fc->nb_streams < 1) |
| 470 | 470 |
return 0; |
| 471 | 471 |
st = fc->streams[fc->nb_streams-1]; |
| 472 | 472 |
|
| 473 | 473 |
avio_rb32(pb); /* version + flags */ |
| 474 |
- len = ff_mp4_read_descr(fc, pb, &tag); |
|
| 474 |
+ ff_mp4_read_descr(fc, pb, &tag); |
|
| 475 | 475 |
if (tag == MP4ESDescrTag) {
|
| 476 | 476 |
avio_rb16(pb); /* ID */ |
| 477 | 477 |
avio_r8(pb); /* priority */ |
| 478 | 478 |
} else |
| 479 | 479 |
avio_rb16(pb); /* ID */ |
| 480 | 480 |
|
| 481 |
- len = ff_mp4_read_descr(fc, pb, &tag); |
|
| 481 |
+ ff_mp4_read_descr(fc, pb, &tag); |
|
| 482 | 482 |
if (tag == MP4DecConfigDescrTag) |
| 483 | 483 |
ff_mp4_read_dec_config_descr(fc, st, pb); |
| 484 | 484 |
return 0; |
| ... | ... |
@@ -196,8 +196,6 @@ static int ogg_read_page(AVFormatContext *s, int *str) |
| 196 | 196 |
int flags, nsegs; |
| 197 | 197 |
uint64_t gp; |
| 198 | 198 |
uint32_t serial; |
| 199 |
- uint32_t seq; |
|
| 200 |
- uint32_t crc; |
|
| 201 | 199 |
int size, idx; |
| 202 | 200 |
uint8_t sync[4]; |
| 203 | 201 |
int sp = 0; |
| ... | ... |
@@ -230,8 +228,7 @@ static int ogg_read_page(AVFormatContext *s, int *str) |
| 230 | 230 |
flags = avio_r8(bc); |
| 231 | 231 |
gp = avio_rl64 (bc); |
| 232 | 232 |
serial = avio_rl32 (bc); |
| 233 |
- seq = avio_rl32 (bc); |
|
| 234 |
- crc = avio_rl32 (bc); |
|
| 233 |
+ avio_skip(bc, 8); /* seq, crc */ |
|
| 235 | 234 |
nsegs = avio_r8(bc); |
| 236 | 235 |
|
| 237 | 236 |
idx = ogg_find_stream (ogg, serial); |
| ... | ... |
@@ -39,7 +39,6 @@ ogm_header(AVFormatContext *s, int idx) |
| 39 | 39 |
const uint8_t *p = os->buf + os->pstart; |
| 40 | 40 |
uint64_t time_unit; |
| 41 | 41 |
uint64_t spu; |
| 42 |
- uint32_t default_len; |
|
| 43 | 42 |
|
| 44 | 43 |
if(!(*p & 1)) |
| 45 | 44 |
return 0; |
| ... | ... |
@@ -74,8 +73,7 @@ ogm_header(AVFormatContext *s, int idx) |
| 74 | 74 |
|
| 75 | 75 |
time_unit = bytestream_get_le64(&p); |
| 76 | 76 |
spu = bytestream_get_le64(&p); |
| 77 |
- default_len = bytestream_get_le32(&p); |
|
| 78 |
- |
|
| 77 |
+ p += 4; /* default_len */ |
|
| 79 | 78 |
p += 8; /* buffersize + bits_per_sample */ |
| 80 | 79 |
|
| 81 | 80 |
if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){
|
| ... | ... |
@@ -80,8 +80,6 @@ static av_cold int rl2_read_header(AVFormatContext *s, |
| 80 | 80 |
unsigned int audio_frame_counter = 0; |
| 81 | 81 |
unsigned int video_frame_counter = 0; |
| 82 | 82 |
unsigned int back_size; |
| 83 |
- int data_size; |
|
| 84 |
- unsigned short encoding_method; |
|
| 85 | 83 |
unsigned short sound_rate; |
| 86 | 84 |
unsigned short rate; |
| 87 | 85 |
unsigned short channels; |
| ... | ... |
@@ -98,14 +96,14 @@ static av_cold int rl2_read_header(AVFormatContext *s, |
| 98 | 98 |
avio_skip(pb,4); /* skip FORM tag */ |
| 99 | 99 |
back_size = avio_rl32(pb); /**< get size of the background frame */ |
| 100 | 100 |
signature = avio_rb32(pb); |
| 101 |
- data_size = avio_rb32(pb); |
|
| 101 |
+ avio_skip(pb, 4); /* data size */ |
|
| 102 | 102 |
frame_count = avio_rl32(pb); |
| 103 | 103 |
|
| 104 | 104 |
/* disallow back_sizes and frame_counts that may lead to overflows later */ |
| 105 | 105 |
if(back_size > INT_MAX/2 || frame_count > INT_MAX / sizeof(uint32_t)) |
| 106 | 106 |
return AVERROR_INVALIDDATA; |
| 107 | 107 |
|
| 108 |
- encoding_method = avio_rl16(pb); |
|
| 108 |
+ avio_skip(pb, 2); /* encoding mentod */ |
|
| 109 | 109 |
sound_rate = avio_rl16(pb); |
| 110 | 110 |
rate = avio_rl16(pb); |
| 111 | 111 |
channels = avio_rl16(pb); |
| ... | ... |
@@ -280,7 +280,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb, |
| 280 | 280 |
if (rm_read_audio_stream_info(s, pb, st, rst, 0)) |
| 281 | 281 |
return -1; |
| 282 | 282 |
} else {
|
| 283 |
- int fps, fps2; |
|
| 283 |
+ int fps; |
|
| 284 | 284 |
if (avio_rl32(pb) != MKTAG('V', 'I', 'D', 'O')) {
|
| 285 | 285 |
fail1: |
| 286 | 286 |
av_log(st->codec, AV_LOG_ERROR, "Unsupported video codec\n"); |
| ... | ... |
@@ -298,7 +298,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb, |
| 298 | 298 |
fps= avio_rb16(pb); |
| 299 | 299 |
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
| 300 | 300 |
avio_rb32(pb); |
| 301 |
- fps2= avio_rb16(pb); |
|
| 301 |
+ avio_skip(pb, 2); |
|
| 302 | 302 |
avio_rb16(pb); |
| 303 | 303 |
|
| 304 | 304 |
if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (avio_tell(pb) - codec_pos))) < 0) |
| ... | ... |
@@ -299,9 +299,9 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 299 | 299 |
stream->codec->codec_tag == 124) {
|
| 300 | 300 |
// We have to split Escape 124 frames because there are |
| 301 | 301 |
// multiple frames per chunk in Escape 124 samples. |
| 302 |
- uint32_t frame_size, frame_flags; |
|
| 302 |
+ uint32_t frame_size; |
|
| 303 | 303 |
|
| 304 |
- frame_flags = avio_rl32(pb); |
|
| 304 |
+ avio_skip(pb, 4); /* flags */ |
|
| 305 | 305 |
frame_size = avio_rl32(pb); |
| 306 | 306 |
if (avio_seek(pb, -8, SEEK_CUR) < 0) |
| 307 | 307 |
return AVERROR(EIO); |
| ... | ... |
@@ -108,8 +108,7 @@ static int parse_fmtp_config(AVStream *st, char *value) |
| 108 | 108 |
int len = ff_hex_to_data(NULL, value), i, ret = 0; |
| 109 | 109 |
GetBitContext gb; |
| 110 | 110 |
uint8_t *config; |
| 111 |
- int audio_mux_version, same_time_framing, num_sub_frames, |
|
| 112 |
- num_programs, num_layers; |
|
| 111 |
+ int audio_mux_version, same_time_framing, num_programs, num_layers; |
|
| 113 | 112 |
|
| 114 | 113 |
/* Pad this buffer, too, to avoid out of bounds reads with get_bits below */ |
| 115 | 114 |
config = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE); |
| ... | ... |
@@ -119,7 +118,7 @@ static int parse_fmtp_config(AVStream *st, char *value) |
| 119 | 119 |
init_get_bits(&gb, config, len*8); |
| 120 | 120 |
audio_mux_version = get_bits(&gb, 1); |
| 121 | 121 |
same_time_framing = get_bits(&gb, 1); |
| 122 |
- num_sub_frames = get_bits(&gb, 6); |
|
| 122 |
+ skip_bits(&gb, 6); /* num_sub_frames */ |
|
| 123 | 123 |
num_programs = get_bits(&gb, 4); |
| 124 | 124 |
num_layers = get_bits(&gb, 3); |
| 125 | 125 |
if (audio_mux_version != 0 || same_time_framing != 1 || num_programs != 0 || |
| ... | ... |
@@ -32,7 +32,7 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g |
| 32 | 32 |
{
|
| 33 | 33 |
AVIOContext *pb = avctx->pb; |
| 34 | 34 |
char buf[36]; |
| 35 |
- int datatype, filetype, t1, t2, nb_comments, flags; |
|
| 35 |
+ int datatype, filetype, t1, t2, nb_comments; |
|
| 36 | 36 |
uint64_t start_pos = avio_size(pb) - 128; |
| 37 | 37 |
|
| 38 | 38 |
avio_seek(pb, start_pos, SEEK_SET); |
| ... | ... |
@@ -57,7 +57,7 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g |
| 57 | 57 |
t1 = avio_rl16(pb); |
| 58 | 58 |
t2 = avio_rl16(pb); |
| 59 | 59 |
nb_comments = avio_r8(pb); |
| 60 |
- flags = avio_r8(pb); |
|
| 60 |
+ avio_skip(pb, 1); /* flags */ |
|
| 61 | 61 |
avio_skip(pb, 4); |
| 62 | 62 |
GET_SAUCE_META("encoder", 22);
|
| 63 | 63 |
|
| ... | ... |
@@ -233,7 +233,6 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 233 | 233 |
int i; |
| 234 | 234 |
int frame_size = 0; |
| 235 | 235 |
int palchange = 0; |
| 236 |
- int pos; |
|
| 237 | 236 |
|
| 238 | 237 |
if (s->pb->eof_reached || smk->cur_frame >= smk->frames) |
| 239 | 238 |
return AVERROR_EOF; |
| ... | ... |
@@ -244,7 +243,6 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 244 | 244 |
frame_size = smk->frm_size[smk->cur_frame] & (~3); |
| 245 | 245 |
flags = smk->frm_flags[smk->cur_frame]; |
| 246 | 246 |
/* handle palette change event */ |
| 247 |
- pos = avio_tell(s->pb); |
|
| 248 | 247 |
if(flags & SMACKER_PAL){
|
| 249 | 248 |
int size, sz, t, off, j, pos; |
| 250 | 249 |
uint8_t *pal = smk->pal; |
| ... | ... |
@@ -85,7 +85,6 @@ static int sol_channels(int magic, int type) |
| 85 | 85 |
static int sol_read_header(AVFormatContext *s, |
| 86 | 86 |
AVFormatParameters *ap) |
| 87 | 87 |
{
|
| 88 |
- int size; |
|
| 89 | 88 |
unsigned int magic,tag; |
| 90 | 89 |
AVIOContext *pb = s->pb; |
| 91 | 90 |
unsigned int id, channels, rate, type; |
| ... | ... |
@@ -99,7 +98,7 @@ static int sol_read_header(AVFormatContext *s, |
| 99 | 99 |
return -1; |
| 100 | 100 |
rate = avio_rl16(pb); |
| 101 | 101 |
type = avio_r8(pb); |
| 102 |
- size = avio_rl32(pb); |
|
| 102 |
+ avio_skip(pb, 4); /* size */ |
|
| 103 | 103 |
if (magic != 0x0B8D) |
| 104 | 104 |
avio_r8(pb); /* newer SOLs contain padding byte */ |
| 105 | 105 |
|
| ... | ... |
@@ -94,7 +94,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 94 | 94 |
AVPicture *picture; |
| 95 | 95 |
int* first_pkt = s->priv_data; |
| 96 | 96 |
int width, height, h_chroma_shift, v_chroma_shift; |
| 97 |
- int i, m; |
|
| 97 |
+ int i; |
|
| 98 | 98 |
char buf2[Y4M_LINE_MAX+1]; |
| 99 | 99 |
char buf1[20]; |
| 100 | 100 |
uint8_t *ptr, *ptr1, *ptr2; |
| ... | ... |
@@ -114,7 +114,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 114 | 114 |
|
| 115 | 115 |
/* construct frame header */ |
| 116 | 116 |
|
| 117 |
- m = snprintf(buf1, sizeof(buf1), "%s\n", Y4M_FRAME_MAGIC); |
|
| 117 |
+ snprintf(buf1, sizeof(buf1), "%s\n", Y4M_FRAME_MAGIC); |
|
| 118 | 118 |
avio_write(pb, buf1, strlen(buf1)); |
| 119 | 119 |
|
| 120 | 120 |
width = st->codec->width; |