Compare commits
90 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 03292829aa | |||
| 96e8400553 | |||
| 54897d7466 | |||
| f2b83f4aba | |||
| 1bc06771d8 | |||
| 2cde8dc055 | |||
| 0da741ba6b | |||
| b66e3e321f | |||
| 1d9830cba3 | |||
| 41a706b912 | |||
| 7a5c738963 | |||
| bdba0f6786 | |||
| badca11741 | |||
| b7c9f27ad6 | |||
| 603845225c | |||
| 3d297038a9 | |||
| 054188db10 | |||
| 454a2405ce | |||
| 01ab4117dc | |||
| 39db2f9514 | |||
| 272a9687a7 | |||
| 9bc2f44c27 | |||
| 85ea121684 | |||
| 79ec638115 | |||
| c8bbddf057 | |||
| cead6c94c5 | |||
| d5bdcd8a27 | |||
| 7bc064d461 | |||
| 70dc266342 | |||
| 2de4eb6fec | |||
| 11a940adbc | |||
| edd0cd21f4 | |||
| 362967fec6 | |||
| a0eccf673c | |||
| fa29141e34 | |||
| f4e25620a1 | |||
| 1c9af4d7a8 | |||
| 78a0356fae | |||
| 4a412dc6ad | |||
| 01439fe1e1 | |||
| 488c2e8487 | |||
| 74104d2dc0 | |||
| 066c657376 | |||
| aac7ca7a36 | |||
| 96fe37a339 | |||
| b3067f95c9 | |||
| 8be48f1c9a | |||
| c1d31ccfac | |||
| c8027878d0 | |||
| 286e3bf174 | |||
| 19fb467fcb | |||
| 67208cf992 | |||
| 56a56c0cb5 | |||
| d3264c496a | |||
| ffa2d60ac5 | |||
| 4a47195d2a | |||
| 912448efc1 | |||
| 6fb7e324fe | |||
| faa84a0c06 | |||
| 02612c3e3e | |||
| 18fbf2622c | |||
| 3d6ffa2bb5 | |||
| b33d302195 | |||
| ca47e9ffdc | |||
| a7aac19933 | |||
| 670d3189e9 | |||
| 60b385a5bf | |||
| b33434ec62 | |||
| 0ccb27e094 | |||
| e8fd32b69f | |||
| 20fd9217d8 | |||
| 48933f28c2 | |||
| d13d3feba2 | |||
| aa6c44c333 | |||
| 0009272f94 | |||
| 7cc854ce15 | |||
| 0a231e7dd3 | |||
| ab43bc50c0 | |||
| 4768b30b5b | |||
| 6b9ffcdb2b | |||
| 520daf8c0e | |||
| c54317a17e | |||
| ab845587d1 | |||
| 4bc16930ef | |||
| b5b52c0ca7 | |||
| 940659036f | |||
| 6d1ebb9def | |||
| 4e341bd904 | |||
| bf6cd808be | |||
| 9f7042f9cd |
@@ -1,6 +1,93 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 3.3.6:
|
||||
- x264: Support version 153
|
||||
- avcodec/exr: Check buf_size more completely
|
||||
- avcodec/flacdec: Fix overflow in multiplication in decode_subframe_fixed()
|
||||
- avcodec/hevcdsp_template: Fix Invalid shifts in put_hevc_qpel_bi_w_h() and put_hevc_qpel_bi_w_w()
|
||||
- avcodec/flacdec: avoid undefined shift
|
||||
- avcodec/hevcdsp_template.c: Fix undefined shift in FUNC(dequant)
|
||||
- avcodec/dirac_dwt: Fix integer overflow in COMPOSE_DD97iH0() and COMPOSE_DD137iL0()
|
||||
- avcodec/hevc_cabac: Fix integer overflow in ff_hevc_cu_qp_delta_abs()
|
||||
- tests/audiomatch: Add missing return code at the end of main()
|
||||
- avcodec/hevc_sei: Fix integer overflows in decode_nal_sei_message()
|
||||
- avcodec/hevcdsp_template: Fix undefined shift in put_hevc_qpel_bi_w_hv()
|
||||
- libavfilter/af_dcshift.c: Fixed repeated spelling error
|
||||
- avfilter/formats: fix wrong function name in error message
|
||||
- avcodec/amrwbdec: Fix division by 0 in voice_factor()
|
||||
- avcodec/diracdsp: Fix integer overflow in PUT_SIGNED_RECT_CLAMPED()
|
||||
- avcodec/dirac_dwt: Fix integer overflows in COMPOSE_DAUB97*
|
||||
- avcodec/extract_extradata_bsf: Fix leak discovered via fuzzing
|
||||
- avcodec/vorbis: Fix another 1 << 31 > int32_t::max() with 1u.
|
||||
- Don't manipulate duration when it's AV_NOPTS_VALUE.
|
||||
- avcodec/vorbis: 1 << 31 > int32_t::max(), so use 1u << 31 instead.
|
||||
- avformat/utils: Prevent undefined shift with wrap_bits > 64.
|
||||
- avcodec/j2kenc: Fix out of array access in encode_cblk()
|
||||
- avcodec/hevcdsp_template: Fix undefined shift in put_hevc_epel_bi_w_h()
|
||||
- avcodec/mlpdsp: Fix signed integer overflow, 2nd try
|
||||
- avcodec/kgv1dec: Check that there is enough input for maximum RLE compression
|
||||
- avcodec/dirac_dwt: Fix integer overflow in COMPOSE_FIDELITYi*
|
||||
- avcodec/mpeg4videodec: Check also for negative versions in the validity check
|
||||
- Close ogg stream upon error when using AV_EF_EXPLODE.
|
||||
- Fix undefined shift on assumed 8-bit input.
|
||||
- Use ff_thread_once for fixed, float table init.
|
||||
- Fix leak of frame_duration_buffer in mov_fix_index().
|
||||
- avformat/mov: Propagate errors in mov_switch_root.
|
||||
- avcodec/hevcdsp_template: Fix invalid shift in put_hevc_epel_bi_w_v()
|
||||
- avcodec/mlpdsp: Fix undefined shift ff_mlp_pack_output()
|
||||
- avcodec/zmbv: Check that the buffer is large enough for mvec
|
||||
- avcodec/dirac_dwt: Fix integer overflow in COMPOSE_DD137iL0()
|
||||
- avcodec/wmv2dec: Check end of bitstream in parse_mb_skip() and ff_wmv2_decode_mb()
|
||||
- avcodec/snowdec: Check for remaining bitstream in decode_blocks()
|
||||
- avcodec/snowdec: Check intra block dc differences.
|
||||
- avformat/mov: Check size of STSC allocation
|
||||
- avcodec/vc2enc: Clear coef_buf on allocation
|
||||
- avcodec/h264dec: Fix potential array overread
|
||||
- avcodec/x86/mpegvideodsp: Fix signedness bug in need_emu
|
||||
- avcodec/aacpsdsp_template: Fix integer overflows in ps_decorrelate_c()
|
||||
- avcodec/aacdec_fixed: Fix undefined shift
|
||||
- avcodec/mdct_*: Fix integer overflow in addition in RESCALE()
|
||||
- avcodec/snowdec: Fix integer overflow in header parsing
|
||||
- avcodec/cngdec: Fix integer clipping
|
||||
- avcodec/sbrdsp_fixed: Fix integer overflow in shift in sbr_hf_g_filt_c()
|
||||
- avcodec/aacsbr_fixed: Fix division by zero in sbr_gain_calc()
|
||||
- avutil/softfloat: Add FLOAT_MIN
|
||||
- avcodec/h264idct_template: Fix integer overflows in ff_h264_idct8_add()
|
||||
- avcodec/xan: Check for bitstream end in xan_huffman_decode()
|
||||
- avcodec/exr: fix undefined shift in pxr24_uncompress()
|
||||
- avformat: Free the internal codec context at the end
|
||||
- avcodec/h264idct_template: Fix integer overflows in ff_h264_idct8_add()
|
||||
- avcodec/xan: Improve overlapping check
|
||||
- avcodec/aacdec_fixed: Fix integer overflow in apply_dependent_coupling_fixed()
|
||||
- avcodec/aacdec_fixed: Fix integer overflow in predict()
|
||||
- avcodec/jpeglsdec: Check for end of bitstream in ls_decode_line()
|
||||
- avcodec/jpeglsdec: Check ilv for being a supported value
|
||||
- lavfi/af_pan: fix sign handling in channel coefficient parser
|
||||
- vc2enc_dwt: pad the temporary buffer by the slice siz
|
||||
|
||||
version 3.3.5:
|
||||
- ffserver: Fix off by 1 error in path
|
||||
- avcodec/snowdec: Check mv_scale
|
||||
- avcodec/pafvideo: Check for bitstream end in decode_0()
|
||||
- avcodec/ffv1dec: Fix out of array read in slice counting
|
||||
- avcodec/dirac_dwt: Fix integer overflow in COMPOSE_53iL0()
|
||||
- avcodec/mpeg_er: Clear mcsel in mpeg_er_decode_mb()
|
||||
- avcodec/mpeg4videodec: Use 64 bit intermediates for sprite delta
|
||||
- avcodec/x86/lossless_videoencdsp: Fix warning: signed dword value exceeds bounds
|
||||
- avcodec/x86/lossless_videoencdsp: Fix handling of small widths
|
||||
- avcodec/truemotion2: Fix integer overflows in tm2_high_chroma()
|
||||
- avcodec/aacdec_template: Clear tns present flag on error
|
||||
- avcodec/proresdec2: SKIP_BITS() does not work with len=32
|
||||
- avcodec/hevcdsp_template: Fix undefined shift
|
||||
- avcodec/jpeg2000: Check that codsty->log2_prec_widths/heights has been initialized
|
||||
- avcodec/takdec: Fix integer overflow in decode_lpc()
|
||||
- avcodec/proresdec2: Check bits in DECODE_CODEWORD(), fixes invalid shift
|
||||
- avcodec/takdec: Fix integer overflows in decode_subframe()
|
||||
- avcodec/dirac_dwt: Fix integer overflow in COMPOSE_FIDELITYi*()
|
||||
- avcodec/ffv1dec: Fix integer overflow in read_quant_table()
|
||||
- avcodec/svq3: Fix overflow in svq3_add_idct_c()
|
||||
- avcodec/pngdec: Clean up on av_frame_ref() failure
|
||||
|
||||
version 3.3.4:
|
||||
- avcodec/hevc_ps: improve check for missing default display window bitstream
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.3.4
|
||||
PROJECT_NUMBER = 3.3.6
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
+9
-13
@@ -476,7 +476,7 @@ static int compute_datarate(DataRateData *drd, int64_t count)
|
||||
static void start_children(FFServerStream *feed)
|
||||
{
|
||||
char *pathname;
|
||||
char *slash;
|
||||
char *dirname, *prog;
|
||||
int i;
|
||||
size_t cmd_length;
|
||||
|
||||
@@ -495,22 +495,18 @@ static void start_children(FFServerStream *feed)
|
||||
return;
|
||||
}
|
||||
|
||||
slash = strrchr(my_program_name, '/');
|
||||
if (!slash) {
|
||||
pathname = av_mallocz(sizeof("ffmpeg"));
|
||||
} else {
|
||||
pathname = av_mallocz(slash - my_program_name + sizeof("ffmpeg"));
|
||||
if (pathname != NULL) {
|
||||
memcpy(pathname, my_program_name, slash - my_program_name);
|
||||
}
|
||||
/* use "ffmpeg" in the path of current program. Ignore user provided path */
|
||||
prog = av_strdup(my_program_name);
|
||||
if (prog) {
|
||||
dirname = av_dirname(prog);
|
||||
pathname = *dirname ? av_asprintf("%s/%s", dirname, "ffmpeg")
|
||||
: av_asprintf("ffmpeg");
|
||||
av_free(prog);
|
||||
}
|
||||
if (!pathname) {
|
||||
if (!prog || !pathname) {
|
||||
http_log("Could not allocate memory for children cmd line\n");
|
||||
return;
|
||||
}
|
||||
/* use "ffmpeg" in the path of current program. Ignore user provided path */
|
||||
|
||||
strcat(pathname, "ffmpeg");
|
||||
|
||||
for (; feed; feed = feed->next) {
|
||||
|
||||
|
||||
@@ -307,9 +307,9 @@ static av_always_inline void predict(PredictorState *ps, int *coef,
|
||||
|
||||
if (shift < 31) {
|
||||
if (shift > 0) {
|
||||
*coef += (pv.mant + (1 << (shift - 1))) >> shift;
|
||||
*coef += (unsigned)((pv.mant + (1 << (shift - 1))) >> shift);
|
||||
} else
|
||||
*coef += pv.mant << -shift;
|
||||
*coef += (unsigned)pv.mant << -shift;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ static void apply_dependent_coupling_fixed(AACContext *ac,
|
||||
for (k = offsets[i]; k < offsets[i + 1]; k++) {
|
||||
tmp = (int)(((int64_t)src[group * 128 + k] * c + \
|
||||
(int64_t)0x1000000000) >> 37);
|
||||
dest[group * 128 + k] += tmp * (1 << shift);
|
||||
dest[group * 128 + k] += tmp * (1U << shift);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1967,16 +1967,17 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
|
||||
global_gain = get_bits(gb, 8);
|
||||
|
||||
if (!common_window && !scale_flag) {
|
||||
if (decode_ics_info(ac, ics, gb) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
ret = decode_ics_info(ac, ics, gb);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((ret = decode_band_types(ac, sce->band_type,
|
||||
sce->band_type_run_end, gb, ics)) < 0)
|
||||
return ret;
|
||||
goto fail;
|
||||
if ((ret = decode_scalefactors(ac, sce->sf, gb, global_gain, ics,
|
||||
sce->band_type, sce->band_type_run_end)) < 0)
|
||||
return ret;
|
||||
goto fail;
|
||||
|
||||
pulse_present = 0;
|
||||
if (!scale_flag) {
|
||||
@@ -1984,37 +1985,48 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Pulse tool not allowed in eight short sequence.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
if (decode_pulses(&pulse, gb, ics->swb_offset, ics->num_swb)) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Pulse data corrupt or invalid.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
tns->present = get_bits1(gb);
|
||||
if (tns->present && !er_syntax)
|
||||
if (decode_tns(ac, tns, gb, ics) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (tns->present && !er_syntax) {
|
||||
ret = decode_tns(ac, tns, gb, ics);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
}
|
||||
if (!eld_syntax && get_bits1(gb)) {
|
||||
avpriv_request_sample(ac->avctx, "SSR");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
ret = AVERROR_PATCHWELCOME;
|
||||
goto fail;
|
||||
}
|
||||
// I see no textual basis in the spec for this occurring after SSR gain
|
||||
// control, but this is what both reference and real implmentations do
|
||||
if (tns->present && er_syntax)
|
||||
if (decode_tns(ac, tns, gb, ics) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (tns->present && er_syntax) {
|
||||
ret = decode_tns(ac, tns, gb, ics);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present,
|
||||
&pulse, ics, sce->band_type) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
ret = decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present,
|
||||
&pulse, ics, sce->band_type);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN && !common_window)
|
||||
apply_prediction(ac, sce);
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
tns->present = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -129,12 +129,12 @@ static void ps_decorrelate_c(INTFLOAT (*out)[2], INTFLOAT (*delay)[2],
|
||||
INTFLOAT apd_im = in_im;
|
||||
in_re = AAC_MSUB30(link_delay_re, fractional_delay_re,
|
||||
link_delay_im, fractional_delay_im);
|
||||
in_re -= a_re;
|
||||
in_re -= (UINTFLOAT)a_re;
|
||||
in_im = AAC_MADD30(link_delay_re, fractional_delay_im,
|
||||
link_delay_im, fractional_delay_re);
|
||||
in_im -= a_im;
|
||||
ap_delay[m][n+5][0] = apd_re + AAC_MUL31(ag[m], in_re);
|
||||
ap_delay[m][n+5][1] = apd_im + AAC_MUL31(ag[m], in_im);
|
||||
in_im -= (UINTFLOAT)a_im;
|
||||
ap_delay[m][n+5][0] = apd_re + (UINTFLOAT)AAC_MUL31(ag[m], in_re);
|
||||
ap_delay[m][n+5][1] = apd_im + (UINTFLOAT)AAC_MUL31(ag[m], in_im);
|
||||
}
|
||||
out[n][0] = AAC_MUL16(transient_gain[n], in_re);
|
||||
out[n][1] = AAC_MUL16(transient_gain[n], in_im);
|
||||
|
||||
@@ -437,6 +437,7 @@ static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr,
|
||||
av_add_sf(FLOAT_1, sbr->e_curr[e][m]),
|
||||
av_add_sf(FLOAT_1, sbr->q_mapped[e][m]))));
|
||||
}
|
||||
sbr->gain[e][m] = av_add_sf(sbr->gain[e][m], FLOAT_MIN);
|
||||
}
|
||||
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
|
||||
sum[0] = av_add_sf(sum[0], sbr->e_origmapped[e][m]);
|
||||
|
||||
@@ -611,7 +611,7 @@ static float voice_factor(float *p_vector, float p_gain,
|
||||
AMRWB_SFR_SIZE) *
|
||||
f_gain * f_gain;
|
||||
|
||||
return (p_ener - f_ener) / (p_ener + f_ener);
|
||||
return (p_ener - f_ener) / (p_ener + f_ener + 0.01);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return ret;
|
||||
buf_out = (int16_t *)frame->data[0];
|
||||
for (i = 0; i < avctx->frame_size; i++)
|
||||
buf_out[i] = p->filter_out[i + p->order];
|
||||
buf_out[i] = av_clip_int16(p->filter_out[i + p->order]);
|
||||
memcpy(p->filter_out, p->filter_out + avctx->frame_size,
|
||||
p->order * sizeof(*p->filter_out));
|
||||
|
||||
|
||||
+10
-10
@@ -93,16 +93,16 @@ void ff_spatial_idwt_slice2(DWTContext *d, int y);
|
||||
|
||||
// shared stuff for simd optimizations
|
||||
#define COMPOSE_53iL0(b0, b1, b2)\
|
||||
(b1 - ((b0 + b2 + 2) >> 2))
|
||||
(b1 - ((int)(b0 + (unsigned)(b2) + 2) >> 2))
|
||||
|
||||
#define COMPOSE_DIRAC53iH0(b0, b1, b2)\
|
||||
(b1 + ((b0 + b2 + 1) >> 1))
|
||||
(b1 + ((int)(b0 + (unsigned)(b2) + 1) >> 1))
|
||||
|
||||
#define COMPOSE_DD97iH0(b0, b1, b2, b3, b4)\
|
||||
(b2 + ((int)(-b0 + 9U*b1 + 9U*b3 - b4 + 8) >> 4))
|
||||
(int)(((unsigned)(b2) + ((int)(-b0 + 9U*b1 + 9U*b3 - b4 + 8) >> 4)))
|
||||
|
||||
#define COMPOSE_DD137iL0(b0, b1, b2, b3, b4)\
|
||||
(b2 - ((-b0 + 9*b1 + 9*b3 - b4 + 16) >> 5))
|
||||
(int)(((unsigned)(b2) - ((int)(-b0 + 9U*b1 + 9U*b3 - b4 + 16) >> 5)))
|
||||
|
||||
#define COMPOSE_HAARiL0(b0, b1)\
|
||||
(b0 - ((b1 + 1) >> 1))
|
||||
@@ -111,22 +111,22 @@ void ff_spatial_idwt_slice2(DWTContext *d, int y);
|
||||
(b0 + b1)
|
||||
|
||||
#define COMPOSE_FIDELITYiL0(b0, b1, b2, b3, b4, b5, b6, b7, b8)\
|
||||
(b4 - ((-8*(b0+b8) + 21*(b1+b7) - 46*(b2+b6) + 161*(b3+b5) + 128) >> 8))
|
||||
((unsigned)b4 - ((int)(-8*(b0+(unsigned)b8) + 21*(b1+(unsigned)b7) - 46*(b2+(unsigned)b6) + 161*(b3+(unsigned)b5) + 128) >> 8))
|
||||
|
||||
#define COMPOSE_FIDELITYiH0(b0, b1, b2, b3, b4, b5, b6, b7, b8)\
|
||||
(b4 + ((-2*(b0+b8) + 10*(b1+b7) - 25*(b2+b6) + 81*(b3+b5) + 128) >> 8))
|
||||
((unsigned)b4 + ((int)(-2*(b0+(unsigned)b8) + 10*(b1+(unsigned)b7) - 25*(b2+(unsigned)b6) + 81*(b3+(unsigned)b5) + 128) >> 8))
|
||||
|
||||
#define COMPOSE_DAUB97iL1(b0, b1, b2)\
|
||||
(b1 - ((int)(1817*(b0 + (unsigned)b2) + 2048) >> 12))
|
||||
((unsigned)(b1) - ((int)(1817*(b0 + (unsigned)b2) + 2048) >> 12))
|
||||
|
||||
#define COMPOSE_DAUB97iH1(b0, b1, b2)\
|
||||
(b1 - ((int)( 113*(b0 + (unsigned)b2) + 64) >> 7))
|
||||
((unsigned)(b1) - ((int)( 113*(b0 + (unsigned)b2) + 64) >> 7))
|
||||
|
||||
#define COMPOSE_DAUB97iL0(b0, b1, b2)\
|
||||
(b1 + ((int)( 217*(b0 + (unsigned)b2) + 2048) >> 12))
|
||||
((unsigned)(b1) + ((int)( 217*(b0 + (unsigned)b2) + 2048) >> 12))
|
||||
|
||||
#define COMPOSE_DAUB97iH0(b0, b1, b2)\
|
||||
(b1 + ((int)(6497*(b0 + (unsigned)b2) + 2048) >> 12))
|
||||
((unsigned)(b1) + ((int)(6497*(b0 + (unsigned)b2) + 2048) >> 12))
|
||||
|
||||
|
||||
#endif /* AVCODEC_DWT_H */
|
||||
|
||||
@@ -159,10 +159,10 @@ static void put_signed_rect_clamped_ ## PX ## bit_c(uint8_t *_dst, int dst_strid
|
||||
int32_t *src = (int32_t *)_src; \
|
||||
for (y = 0; y < height; y++) { \
|
||||
for (x = 0; x < width; x+=4) { \
|
||||
dst[x ] = av_clip_uintp2(src[x ] + (1 << (PX - 1)), PX); \
|
||||
dst[x+1] = av_clip_uintp2(src[x+1] + (1 << (PX - 1)), PX); \
|
||||
dst[x+2] = av_clip_uintp2(src[x+2] + (1 << (PX - 1)), PX); \
|
||||
dst[x+3] = av_clip_uintp2(src[x+3] + (1 << (PX - 1)), PX); \
|
||||
dst[x ] = av_clip_uintp2(src[x ] + (1U << (PX - 1)), PX); \
|
||||
dst[x+1] = av_clip_uintp2(src[x+1] + (1U << (PX - 1)), PX); \
|
||||
dst[x+2] = av_clip_uintp2(src[x+2] + (1U << (PX - 1)), PX); \
|
||||
dst[x+3] = av_clip_uintp2(src[x+3] + (1U << (PX - 1)), PX); \
|
||||
} \
|
||||
dst += dst_stride >> 1; \
|
||||
src += src_stride >> 2; \
|
||||
|
||||
+5
-5
@@ -866,7 +866,7 @@ static int pxr24_uncompress(EXRContext *s, const uint8_t *src,
|
||||
in = ptr[2] + td->xsize;
|
||||
|
||||
for (j = 0; j < td->xsize; ++j) {
|
||||
uint32_t diff = (*(ptr[0]++) << 24) |
|
||||
uint32_t diff = ((unsigned)*(ptr[0]++) << 24) |
|
||||
(*(ptr[1]++) << 16) |
|
||||
(*(ptr[2]++) << 8);
|
||||
pixel += diff;
|
||||
@@ -1062,7 +1062,7 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
|
||||
line_offset = AV_RL64(s->gb.buffer + jobnr * 8);
|
||||
|
||||
if (s->is_tile) {
|
||||
if (line_offset > buf_size - 20)
|
||||
if (buf_size < 20 || line_offset > buf_size - 20)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
src = buf + line_offset + 20;
|
||||
@@ -1073,7 +1073,7 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
|
||||
tileLevelY = AV_RL32(src - 8);
|
||||
|
||||
data_size = AV_RL32(src - 4);
|
||||
if (data_size <= 0 || data_size > buf_size)
|
||||
if (data_size <= 0 || data_size > buf_size - line_offset - 20)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (tileLevelX || tileLevelY) { /* tile level, is not the full res level */
|
||||
@@ -1106,7 +1106,7 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
|
||||
td->channel_line_size = td->xsize * s->current_channel_offset;/* uncompress size of one line */
|
||||
uncompressed_size = td->channel_line_size * (uint64_t)td->ysize;/* uncompress size of the block */
|
||||
} else {
|
||||
if (line_offset > buf_size - 8)
|
||||
if (buf_size < 8 || line_offset > buf_size - 8)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
src = buf + line_offset + 8;
|
||||
@@ -1116,7 +1116,7 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
data_size = AV_RL32(src - 4);
|
||||
if (data_size <= 0 || data_size > buf_size)
|
||||
if (data_size <= 0 || data_size > buf_size - line_offset - 8)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
td->ysize = FFMIN(s->scan_lines_per_block, s->ymax - line + 1); /* s->ydelta - line ?? */
|
||||
|
||||
@@ -78,7 +78,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
|
||||
ret = ff_h2645_packet_split(&h2645_pkt, pkt->data, pkt->size,
|
||||
ctx, 0, 0, ctx->par_in->codec_id, 1);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
goto fail;
|
||||
|
||||
for (i = 0; i < h2645_pkt.nb_nals; i++) {
|
||||
H2645NAL *nal = &h2645_pkt.nals[i];
|
||||
@@ -101,14 +101,17 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
|
||||
|
||||
if (s->remove) {
|
||||
filtered_buf = av_buffer_alloc(pkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!filtered_buf)
|
||||
if (!filtered_buf) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
filtered_data = filtered_buf->data;
|
||||
}
|
||||
|
||||
extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!extradata) {
|
||||
av_buffer_unref(&filtered_buf);
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale)
|
||||
memset(state, 128, sizeof(state));
|
||||
|
||||
for (v = 0; i < 128; v++) {
|
||||
unsigned len = get_symbol(c, state, 0) + 1;
|
||||
unsigned len = get_symbol(c, state, 0) + 1U;
|
||||
|
||||
if (len > 128 - i || !len)
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -699,7 +699,7 @@ static int read_header(FFV1Context *f)
|
||||
} else {
|
||||
const uint8_t *p = c->bytestream_end;
|
||||
for (f->slice_count = 0;
|
||||
f->slice_count < MAX_SLICES && 3 < p - c->bytestream_start;
|
||||
f->slice_count < MAX_SLICES && 3 + 5*!!f->ec < p - c->bytestream_start;
|
||||
f->slice_count++) {
|
||||
int trailer = 3 + 5*!!f->ec;
|
||||
int size = AV_RB24(p-trailer);
|
||||
|
||||
@@ -298,7 +298,7 @@ static int decode_subframe_fixed(FLACContext *s, int32_t *decoded,
|
||||
if (pred_order > 2)
|
||||
c = b - decoded[pred_order-2] + decoded[pred_order-3];
|
||||
if (pred_order > 3)
|
||||
d = c - decoded[pred_order-2] + 2*decoded[pred_order-3] - decoded[pred_order-4];
|
||||
d = c - decoded[pred_order-2] + 2U*decoded[pred_order-3] - decoded[pred_order-4];
|
||||
|
||||
switch (pred_order) {
|
||||
case 0:
|
||||
@@ -456,7 +456,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (wasted) {
|
||||
if (wasted && wasted < 32) {
|
||||
int i;
|
||||
for (i = 0; i < s->blocksize; i++)
|
||||
decoded[i] = (unsigned)decoded[i] << wasted;
|
||||
|
||||
@@ -415,6 +415,7 @@ typedef struct H264Context {
|
||||
uint8_t (*mvd_table[2])[2];
|
||||
uint8_t *direct_table;
|
||||
|
||||
uint8_t scan_padding[16];
|
||||
uint8_t zigzag_scan[16];
|
||||
uint8_t zigzag_scan8x8[64];
|
||||
uint8_t zigzag_scan8x8_cavlc[64];
|
||||
|
||||
@@ -91,10 +91,10 @@ void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, int16_t *_block, int stride){
|
||||
const int a5 = -block[i+1*8] + block[i+7*8] + block[i+5*8] + (block[i+5*8]>>1);
|
||||
const int a7 = block[i+3*8] + block[i+5*8] + block[i+1*8] + (block[i+1*8]>>1);
|
||||
|
||||
const int b1 = (a7>>2) + a1;
|
||||
const int b3 = a3 + (a5>>2);
|
||||
const int b5 = (a3>>2) - a5;
|
||||
const int b7 = a7 - (a1>>2);
|
||||
const int b1 = (a7>>2) + (unsigned)a1;
|
||||
const int b3 = (unsigned)a3 + (a5>>2);
|
||||
const int b5 = (a3>>2) - (unsigned)a5;
|
||||
const int b7 = (unsigned)a7 - (a1>>2);
|
||||
|
||||
block[i+0*8] = b0 + b7;
|
||||
block[i+7*8] = b0 - b7;
|
||||
@@ -107,10 +107,10 @@ void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, int16_t *_block, int stride){
|
||||
}
|
||||
for( i = 0; i < 8; i++ )
|
||||
{
|
||||
const unsigned a0 = block[0+i*8] + block[4+i*8];
|
||||
const unsigned a2 = block[0+i*8] - block[4+i*8];
|
||||
const unsigned a4 = (block[2+i*8]>>1) - block[6+i*8];
|
||||
const unsigned a6 = (block[6+i*8]>>1) + block[2+i*8];
|
||||
const unsigned a0 = block[0+i*8] + (unsigned)block[4+i*8];
|
||||
const unsigned a2 = block[0+i*8] - (unsigned)block[4+i*8];
|
||||
const unsigned a4 = (block[2+i*8]>>1) - (unsigned)block[6+i*8];
|
||||
const unsigned a6 = (block[6+i*8]>>1) + (unsigned)block[2+i*8];
|
||||
|
||||
const unsigned b0 = a0 + a6;
|
||||
const unsigned b2 = a2 + a4;
|
||||
|
||||
@@ -635,8 +635,10 @@ int ff_hevc_cu_qp_delta_abs(HEVCContext *s)
|
||||
suffix_val += 1 << k;
|
||||
k++;
|
||||
}
|
||||
if (k == CABAC_MAX_BIN)
|
||||
if (k == CABAC_MAX_BIN) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "CABAC_MAX_BIN : %d\n", k);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
while (k--)
|
||||
suffix_val += get_cabac_bypass(&s->HEVClc->cc) << k;
|
||||
|
||||
@@ -344,11 +344,15 @@ static int decode_nal_sei_message(HEVCContext *s)
|
||||
av_log(s->avctx, AV_LOG_DEBUG, "Decoding SEI\n");
|
||||
|
||||
while (byte == 0xFF) {
|
||||
if (get_bits_left(gb) < 16 || payload_type > INT_MAX - 255)
|
||||
return AVERROR_INVALIDDATA;
|
||||
byte = get_bits(gb, 8);
|
||||
payload_type += byte;
|
||||
}
|
||||
byte = 0xFF;
|
||||
while (byte == 0xFF) {
|
||||
if (get_bits_left(gb) < 8 + 8LL*payload_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
byte = get_bits(gb, 8);
|
||||
payload_size += byte;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ static void FUNC(dequant)(int16_t *coeffs, int16_t log2_size)
|
||||
} else {
|
||||
for (y = 0; y < size; y++) {
|
||||
for (x = 0; x < size; x++) {
|
||||
*coeffs = *coeffs << -shift;
|
||||
*coeffs = *(uint16_t*)coeffs << -shift;
|
||||
coeffs++;
|
||||
}
|
||||
}
|
||||
@@ -915,7 +915,7 @@ static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
dst[x] = av_clip_pixel(((QPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx1 + src2[x] * wx0 +
|
||||
((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
|
||||
((ox0 + ox1 + 1) * (1 << log2Wd))) >> (log2Wd + 1));
|
||||
src += srcstride;
|
||||
dst += dststride;
|
||||
src2 += MAX_PB_SIZE;
|
||||
@@ -970,7 +970,7 @@ static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
dst[x] = av_clip_pixel(((QPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx1 + src2[x] * wx0 +
|
||||
((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
|
||||
((ox0 + ox1 + 1) * (1 << log2Wd))) >> (log2Wd + 1));
|
||||
src += srcstride;
|
||||
dst += dststride;
|
||||
src2 += MAX_PB_SIZE;
|
||||
@@ -1051,7 +1051,7 @@ static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uin
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
dst[x] = av_clip_pixel(((QPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) * wx1 + src2[x] * wx0 +
|
||||
((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
|
||||
((ox0 + ox1 + 1) * (1 << log2Wd))) >> (log2Wd + 1));
|
||||
tmp += MAX_PB_SIZE;
|
||||
dst += dststride;
|
||||
src2 += MAX_PB_SIZE;
|
||||
@@ -1355,7 +1355,7 @@ static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
dst[x] = av_clip_pixel(((EPEL_FILTER(src, 1) >> (BIT_DEPTH - 8)) * wx1 + src2[x] * wx0 +
|
||||
((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
|
||||
((ox0 + ox1 + 1) * (1 << log2Wd))) >> (log2Wd + 1));
|
||||
src += srcstride;
|
||||
dst += dststride;
|
||||
src2 += MAX_PB_SIZE;
|
||||
@@ -1407,7 +1407,7 @@ static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
dst[x] = av_clip_pixel(((EPEL_FILTER(src, srcstride) >> (BIT_DEPTH - 8)) * wx1 + src2[x] * wx0 +
|
||||
((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
|
||||
((ox0 + ox1 + 1) * (1 << log2Wd))) >> (log2Wd + 1));
|
||||
src += srcstride;
|
||||
dst += dststride;
|
||||
src2 += MAX_PB_SIZE;
|
||||
@@ -1486,7 +1486,7 @@ static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uin
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
dst[x] = av_clip_pixel(((EPEL_FILTER(tmp, MAX_PB_SIZE) >> 6) * wx1 + src2[x] * wx0 +
|
||||
((ox0 + ox1 + 1) << log2Wd)) >> (log2Wd + 1));
|
||||
((ox0 + ox1 + 1) * (1 << log2Wd))) >> (log2Wd + 1));
|
||||
tmp += MAX_PB_SIZE;
|
||||
dst += dststride;
|
||||
src2 += MAX_PB_SIZE;
|
||||
|
||||
+2
-1
@@ -688,7 +688,8 @@ static void encode_cblk(Jpeg2000EncoderContext *s, Jpeg2000T1Context *t1, Jpeg20
|
||||
cblk->npasses = passno;
|
||||
cblk->ninclpasses = passno;
|
||||
|
||||
cblk->passes[passno-1].rate = ff_mqc_flush_to(&t1->mqc, cblk->passes[passno-1].flushed, &cblk->passes[passno-1].flushed_len);
|
||||
if (passno)
|
||||
cblk->passes[passno-1].rate = ff_mqc_flush_to(&t1->mqc, cblk->passes[passno-1].flushed, &cblk->passes[passno-1].flushed_len);
|
||||
}
|
||||
|
||||
/* tier-2 routines: */
|
||||
|
||||
@@ -506,6 +506,9 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
|
||||
// update precincts size: 2^n value
|
||||
reslevel->log2_prec_width = codsty->log2_prec_widths[reslevelno];
|
||||
reslevel->log2_prec_height = codsty->log2_prec_heights[reslevelno];
|
||||
if (!reslevel->log2_prec_width || !reslevel->log2_prec_height) {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/* Number of bands for each resolution level */
|
||||
if (reslevelno == 0)
|
||||
|
||||
@@ -233,6 +233,9 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s,
|
||||
while (x < w) {
|
||||
int err, pred;
|
||||
|
||||
if (get_bits_left(&s->gb) <= 0)
|
||||
return;
|
||||
|
||||
/* compute gradients */
|
||||
Ra = x ? R(dst, x - stride) : R(last, x);
|
||||
Rb = R(last, x);
|
||||
@@ -443,6 +446,10 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
|
||||
avpriv_report_missing_feature(s->avctx, "Sample interleaved images");
|
||||
ret = AVERROR_PATCHWELCOME;
|
||||
goto end;
|
||||
} else { /* unknown interleaving */
|
||||
avpriv_report_missing_feature(s->avctx, "Unknown interleaved images");
|
||||
ret = AVERROR_PATCHWELCOME;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (s->xfrm && s->nb_components == 3) {
|
||||
|
||||
@@ -62,6 +62,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
h = (buf[1] + 1) * 8;
|
||||
buf += 2;
|
||||
|
||||
if (avpkt->size < 2 + w*h / 513)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (w != avctx->width || h != avctx->height) {
|
||||
av_freep(&c->frame_buffer);
|
||||
av_freep(&c->last_frame_buffer);
|
||||
|
||||
@@ -279,7 +279,11 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
|
||||
|
||||
x264_picture_init( &x4->pic );
|
||||
x4->pic.img.i_csp = x4->params.i_csp;
|
||||
#if X264_BUILD >= 153
|
||||
if (x4->params.i_bitdepth > 8)
|
||||
#else
|
||||
if (x264_bit_depth > 8)
|
||||
#endif
|
||||
x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
|
||||
x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt);
|
||||
|
||||
@@ -490,6 +494,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
|
||||
x4->params.p_log_private = avctx;
|
||||
x4->params.i_log_level = X264_LOG_DEBUG;
|
||||
x4->params.i_csp = convert_pix_fmt(avctx->pix_fmt);
|
||||
#if X264_BUILD >= 153
|
||||
x4->params.i_bitdepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth;
|
||||
#endif
|
||||
|
||||
PARSE_X264_OPT("weightp", wpredp);
|
||||
|
||||
@@ -878,6 +885,24 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
|
||||
AV_PIX_FMT_NV20,
|
||||
AV_PIX_FMT_NONE
|
||||
};
|
||||
static const enum AVPixelFormat pix_fmts_all[] = {
|
||||
AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUVJ420P,
|
||||
AV_PIX_FMT_YUV422P,
|
||||
AV_PIX_FMT_YUVJ422P,
|
||||
AV_PIX_FMT_YUV444P,
|
||||
AV_PIX_FMT_YUVJ444P,
|
||||
AV_PIX_FMT_NV12,
|
||||
AV_PIX_FMT_NV16,
|
||||
#ifdef X264_CSP_NV21
|
||||
AV_PIX_FMT_NV21,
|
||||
#endif
|
||||
AV_PIX_FMT_YUV420P10,
|
||||
AV_PIX_FMT_YUV422P10,
|
||||
AV_PIX_FMT_YUV444P10,
|
||||
AV_PIX_FMT_NV20,
|
||||
AV_PIX_FMT_NONE
|
||||
};
|
||||
#if CONFIG_LIBX264RGB_ENCODER
|
||||
static const enum AVPixelFormat pix_fmts_8bit_rgb[] = {
|
||||
AV_PIX_FMT_BGR0,
|
||||
@@ -889,12 +914,16 @@ static const enum AVPixelFormat pix_fmts_8bit_rgb[] = {
|
||||
|
||||
static av_cold void X264_init_static(AVCodec *codec)
|
||||
{
|
||||
#if X264_BUILD < 153
|
||||
if (x264_bit_depth == 8)
|
||||
codec->pix_fmts = pix_fmts_8bit;
|
||||
else if (x264_bit_depth == 9)
|
||||
codec->pix_fmts = pix_fmts_9bit;
|
||||
else if (x264_bit_depth == 10)
|
||||
codec->pix_fmts = pix_fmts_10bit;
|
||||
#else
|
||||
codec->pix_fmts = pix_fmts_all;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define OFFSET(x) offsetof(X264Context, x)
|
||||
|
||||
@@ -39,13 +39,13 @@ void ff_mdct_calcw_c(FFTContext *s, FFTDouble *out, const FFTSample *input)
|
||||
|
||||
/* pre rotation */
|
||||
for(i=0;i<n8;i++) {
|
||||
re = RSCALE(-input[2*i+n3] - input[n3-1-2*i]);
|
||||
im = RSCALE(-input[n4+2*i] + input[n4-1-2*i]);
|
||||
re = RSCALE(-input[2*i+n3], - input[n3-1-2*i]);
|
||||
im = RSCALE(-input[n4+2*i], + input[n4-1-2*i]);
|
||||
j = revtab[i];
|
||||
CMUL(x[j].re, x[j].im, re, im, -tcos[i], tsin[i]);
|
||||
|
||||
re = RSCALE( input[2*i] - input[n2-1-2*i]);
|
||||
im = RSCALE(-input[n2+2*i] - input[ n-1-2*i]);
|
||||
re = RSCALE( input[2*i] , - input[n2-1-2*i]);
|
||||
im = RSCALE(-input[n2+2*i], - input[ n-1-2*i]);
|
||||
j = revtab[n8 + i];
|
||||
CMUL(x[j].re, x[j].im, re, im, -tcos[n8 + i], tsin[n8 + i]);
|
||||
}
|
||||
|
||||
@@ -33,12 +33,12 @@
|
||||
*/
|
||||
|
||||
#if FFT_FLOAT
|
||||
# define RSCALE(x) (x)
|
||||
# define RSCALE(x, y) ((x) + (y))
|
||||
#else
|
||||
#if FFT_FIXED_32
|
||||
# define RSCALE(x) (((x) + 32) >> 6)
|
||||
# define RSCALE(x, y) ((int)((x) + (unsigned)(y) + 32) >> 6)
|
||||
#else /* FFT_FIXED_32 */
|
||||
# define RSCALE(x) ((x) >> 1)
|
||||
# define RSCALE(x, y) ((int)((x) + (unsigned)(y)) >> 1)
|
||||
#endif /* FFT_FIXED_32 */
|
||||
#endif
|
||||
|
||||
@@ -181,13 +181,13 @@ void ff_mdct_calc_c(FFTContext *s, FFTSample *out, const FFTSample *input)
|
||||
|
||||
/* pre rotation */
|
||||
for(i=0;i<n8;i++) {
|
||||
re = RSCALE(-input[2*i+n3] - input[n3-1-2*i]);
|
||||
im = RSCALE(-input[n4+2*i] + input[n4-1-2*i]);
|
||||
re = RSCALE(-input[2*i+n3], - input[n3-1-2*i]);
|
||||
im = RSCALE(-input[n4+2*i], + input[n4-1-2*i]);
|
||||
j = revtab[i];
|
||||
CMUL(x[j].re, x[j].im, re, im, -tcos[i], tsin[i]);
|
||||
|
||||
re = RSCALE( input[2*i] - input[n2-1-2*i]);
|
||||
im = RSCALE(-input[n2+2*i] - input[ n-1-2*i]);
|
||||
re = RSCALE( input[2*i] , - input[n2-1-2*i]);
|
||||
im = RSCALE(-input[n2+2*i], - input[ n-1-2*i]);
|
||||
j = revtab[n8 + i];
|
||||
CMUL(x[j].re, x[j].im, re, im, -tcos[n8 + i], tsin[n8 + i]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ int32_t ff_mlp_pack_output(int32_t lossless_check_data,
|
||||
(1U << output_shift[mat_ch]);
|
||||
lossless_check_data ^= (sample & 0xffffff) << mat_ch;
|
||||
if (is32)
|
||||
*data_32++ = sample << 8;
|
||||
*data_32++ = sample * 256U;
|
||||
else
|
||||
*data_16++ = sample >> 8;
|
||||
}
|
||||
|
||||
+49
-41
@@ -179,6 +179,7 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
|
||||
int sprite_ref[4][2];
|
||||
int virtual_ref[2][2];
|
||||
int64_t sprite_offset[2][2];
|
||||
int64_t sprite_delta[2][2];
|
||||
|
||||
// only true for rectangle shapes
|
||||
const int vop_ref[4][2] = { { 0, 0 }, { s->width, 0 },
|
||||
@@ -262,10 +263,10 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
|
||||
sprite_offset[0][1] =
|
||||
sprite_offset[1][0] =
|
||||
sprite_offset[1][1] = 0;
|
||||
s->sprite_delta[0][0] = a;
|
||||
s->sprite_delta[0][1] =
|
||||
s->sprite_delta[1][0] = 0;
|
||||
s->sprite_delta[1][1] = a;
|
||||
sprite_delta[0][0] = a;
|
||||
sprite_delta[0][1] =
|
||||
sprite_delta[1][0] = 0;
|
||||
sprite_delta[1][1] = a;
|
||||
ctx->sprite_shift[0] =
|
||||
ctx->sprite_shift[1] = 0;
|
||||
break;
|
||||
@@ -276,10 +277,10 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
|
||||
a * (vop_ref[0][0] / 2);
|
||||
sprite_offset[1][1] = ((sprite_ref[0][1] >> 1) | (sprite_ref[0][1] & 1)) -
|
||||
a * (vop_ref[0][1] / 2);
|
||||
s->sprite_delta[0][0] = a;
|
||||
s->sprite_delta[0][1] =
|
||||
s->sprite_delta[1][0] = 0;
|
||||
s->sprite_delta[1][1] = a;
|
||||
sprite_delta[0][0] = a;
|
||||
sprite_delta[0][1] =
|
||||
sprite_delta[1][0] = 0;
|
||||
sprite_delta[1][1] = a;
|
||||
ctx->sprite_shift[0] =
|
||||
ctx->sprite_shift[1] = 0;
|
||||
break;
|
||||
@@ -304,10 +305,10 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
|
||||
((int64_t)-r * sprite_ref[0][0] + virtual_ref[0][0]) *
|
||||
((int64_t)-2 * vop_ref[0][1] + 1) + 2 * w2 * r *
|
||||
(int64_t) sprite_ref[0][1] - 16 * w2 + (1 << (alpha + rho + 1)));
|
||||
s->sprite_delta[0][0] = (-r * sprite_ref[0][0] + virtual_ref[0][0]);
|
||||
s->sprite_delta[0][1] = (+r * sprite_ref[0][1] - virtual_ref[0][1]);
|
||||
s->sprite_delta[1][0] = (-r * sprite_ref[0][1] + virtual_ref[0][1]);
|
||||
s->sprite_delta[1][1] = (-r * sprite_ref[0][0] + virtual_ref[0][0]);
|
||||
sprite_delta[0][0] = (-r * sprite_ref[0][0] + virtual_ref[0][0]);
|
||||
sprite_delta[0][1] = (+r * sprite_ref[0][1] - virtual_ref[0][1]);
|
||||
sprite_delta[1][0] = (-r * sprite_ref[0][1] + virtual_ref[0][1]);
|
||||
sprite_delta[1][1] = (-r * sprite_ref[0][0] + virtual_ref[0][0]);
|
||||
|
||||
ctx->sprite_shift[0] = alpha + rho;
|
||||
ctx->sprite_shift[1] = alpha + rho + 2;
|
||||
@@ -332,28 +333,28 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
|
||||
((int64_t)-r * sprite_ref[0][1] + virtual_ref[1][1]) * w3 * (-2 * vop_ref[0][1] + 1) +
|
||||
(int64_t)2 * w2 * h3 * r * sprite_ref[0][1] - 16 * w2 * h3 +
|
||||
((int64_t)1 << (alpha + beta + rho - min_ab + 1));
|
||||
s->sprite_delta[0][0] = (-r * sprite_ref[0][0] + virtual_ref[0][0]) * h3;
|
||||
s->sprite_delta[0][1] = (-r * sprite_ref[0][0] + virtual_ref[1][0]) * w3;
|
||||
s->sprite_delta[1][0] = (-r * sprite_ref[0][1] + virtual_ref[0][1]) * h3;
|
||||
s->sprite_delta[1][1] = (-r * sprite_ref[0][1] + virtual_ref[1][1]) * w3;
|
||||
sprite_delta[0][0] = (-r * (int64_t)sprite_ref[0][0] + virtual_ref[0][0]) * h3;
|
||||
sprite_delta[0][1] = (-r * (int64_t)sprite_ref[0][0] + virtual_ref[1][0]) * w3;
|
||||
sprite_delta[1][0] = (-r * (int64_t)sprite_ref[0][1] + virtual_ref[0][1]) * h3;
|
||||
sprite_delta[1][1] = (-r * (int64_t)sprite_ref[0][1] + virtual_ref[1][1]) * w3;
|
||||
|
||||
ctx->sprite_shift[0] = alpha + beta + rho - min_ab;
|
||||
ctx->sprite_shift[1] = alpha + beta + rho - min_ab + 2;
|
||||
break;
|
||||
}
|
||||
/* try to simplify the situation */
|
||||
if (s->sprite_delta[0][0] == a << ctx->sprite_shift[0] &&
|
||||
s->sprite_delta[0][1] == 0 &&
|
||||
s->sprite_delta[1][0] == 0 &&
|
||||
s->sprite_delta[1][1] == a << ctx->sprite_shift[0]) {
|
||||
if (sprite_delta[0][0] == a << ctx->sprite_shift[0] &&
|
||||
sprite_delta[0][1] == 0 &&
|
||||
sprite_delta[1][0] == 0 &&
|
||||
sprite_delta[1][1] == a << ctx->sprite_shift[0]) {
|
||||
sprite_offset[0][0] >>= ctx->sprite_shift[0];
|
||||
sprite_offset[0][1] >>= ctx->sprite_shift[0];
|
||||
sprite_offset[1][0] >>= ctx->sprite_shift[1];
|
||||
sprite_offset[1][1] >>= ctx->sprite_shift[1];
|
||||
s->sprite_delta[0][0] = a;
|
||||
s->sprite_delta[0][1] = 0;
|
||||
s->sprite_delta[1][0] = 0;
|
||||
s->sprite_delta[1][1] = a;
|
||||
sprite_delta[0][0] = a;
|
||||
sprite_delta[0][1] = 0;
|
||||
sprite_delta[1][0] = 0;
|
||||
sprite_delta[1][1] = a;
|
||||
ctx->sprite_shift[0] = 0;
|
||||
ctx->sprite_shift[1] = 0;
|
||||
s->real_sprite_warping_points = 1;
|
||||
@@ -365,8 +366,8 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
|
||||
if (shift_c < 0 || shift_y < 0 ||
|
||||
FFABS( sprite_offset[0][i]) >= INT_MAX >> shift_y ||
|
||||
FFABS( sprite_offset[1][i]) >= INT_MAX >> shift_c ||
|
||||
FFABS(s->sprite_delta[0][i]) >= INT_MAX >> shift_y ||
|
||||
FFABS(s->sprite_delta[1][i]) >= INT_MAX >> shift_y
|
||||
FFABS( sprite_delta[0][i]) >= INT_MAX >> shift_y ||
|
||||
FFABS( sprite_delta[1][i]) >= INT_MAX >> shift_y
|
||||
) {
|
||||
avpriv_request_sample(s->avctx, "Too large sprite shift, delta or offset");
|
||||
goto overflow;
|
||||
@@ -376,22 +377,22 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
|
||||
for (i = 0; i < 2; i++) {
|
||||
sprite_offset[0][i] *= 1 << shift_y;
|
||||
sprite_offset[1][i] *= 1 << shift_c;
|
||||
s->sprite_delta[0][i] *= 1 << shift_y;
|
||||
s->sprite_delta[1][i] *= 1 << shift_y;
|
||||
sprite_delta[0][i] *= 1 << shift_y;
|
||||
sprite_delta[1][i] *= 1 << shift_y;
|
||||
ctx->sprite_shift[i] = 16;
|
||||
|
||||
}
|
||||
for (i = 0; i < 2; i++) {
|
||||
int64_t sd[2] = {
|
||||
s->sprite_delta[i][0] - a * (1LL<<16),
|
||||
s->sprite_delta[i][1] - a * (1LL<<16)
|
||||
sprite_delta[i][0] - a * (1LL<<16),
|
||||
sprite_delta[i][1] - a * (1LL<<16)
|
||||
};
|
||||
|
||||
if (llabs(sprite_offset[0][i] + s->sprite_delta[i][0] * (w+16LL)) >= INT_MAX ||
|
||||
llabs(sprite_offset[0][i] + s->sprite_delta[i][1] * (h+16LL)) >= INT_MAX ||
|
||||
llabs(sprite_offset[0][i] + s->sprite_delta[i][0] * (w+16LL) + s->sprite_delta[i][1] * (h+16LL)) >= INT_MAX ||
|
||||
llabs(s->sprite_delta[i][0] * (w+16LL)) >= INT_MAX ||
|
||||
llabs(s->sprite_delta[i][1] * (w+16LL)) >= INT_MAX ||
|
||||
if (llabs(sprite_offset[0][i] + sprite_delta[i][0] * (w+16LL)) >= INT_MAX ||
|
||||
llabs(sprite_offset[0][i] + sprite_delta[i][1] * (h+16LL)) >= INT_MAX ||
|
||||
llabs(sprite_offset[0][i] + sprite_delta[i][0] * (w+16LL) + sprite_delta[i][1] * (h+16LL)) >= INT_MAX ||
|
||||
llabs(sprite_delta[i][0] * (w+16LL)) >= INT_MAX ||
|
||||
llabs(sprite_delta[i][1] * (w+16LL)) >= INT_MAX ||
|
||||
llabs(sd[0]) >= INT_MAX ||
|
||||
llabs(sd[1]) >= INT_MAX ||
|
||||
llabs(sprite_offset[0][i] + sd[0] * (w+16LL)) >= INT_MAX ||
|
||||
@@ -405,10 +406,10 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
|
||||
s->real_sprite_warping_points = ctx->num_sprite_warping_points;
|
||||
}
|
||||
|
||||
s->sprite_offset[0][0] = sprite_offset[0][0];
|
||||
s->sprite_offset[0][1] = sprite_offset[0][1];
|
||||
s->sprite_offset[1][0] = sprite_offset[1][0];
|
||||
s->sprite_offset[1][1] = sprite_offset[1][1];
|
||||
for (i = 0; i < 4; i++) {
|
||||
s->sprite_offset[i&1][i>>1] = sprite_offset[i&1][i>>1];
|
||||
s->sprite_delta [i&1][i>>1] = sprite_delta [i&1][i>>1];
|
||||
}
|
||||
|
||||
return 0;
|
||||
overflow:
|
||||
@@ -2148,8 +2149,15 @@ static int decode_user_data(Mpeg4DecContext *ctx, GetBitContext *gb)
|
||||
e = sscanf(buf, "FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build);
|
||||
if (e != 4) {
|
||||
e = sscanf(buf, "Lavc%d.%d.%d", &ver, &ver2, &ver3) + 1;
|
||||
if (e > 1)
|
||||
build = (ver << 16) + (ver2 << 8) + ver3;
|
||||
if (e > 1) {
|
||||
if (ver > 0xFFU || ver2 > 0xFFU || ver3 > 0xFFU) {
|
||||
av_log(s->avctx, AV_LOG_WARNING,
|
||||
"Unknown Lavc version string encountered, %d.%d.%d; "
|
||||
"clamping sub-version values to 8-bits.\n",
|
||||
ver, ver2, ver3);
|
||||
}
|
||||
build = ((ver & 0xFF) << 16) + ((ver2 & 0xFF) << 8) + (ver3 & 0xFF);
|
||||
}
|
||||
}
|
||||
if (e != 4) {
|
||||
if (strcmp(buf, "ffmpeg") == 0)
|
||||
|
||||
@@ -71,6 +71,7 @@ static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
|
||||
s->mb_skipped = mb_skipped;
|
||||
s->mb_x = mb_x;
|
||||
s->mb_y = mb_y;
|
||||
s->mcsel = 0;
|
||||
memcpy(s->mv, mv, sizeof(*mv));
|
||||
|
||||
ff_init_block_index(s);
|
||||
|
||||
@@ -20,17 +20,21 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/thread.h"
|
||||
#include "mpegaudiodsp.h"
|
||||
#include "dct.h"
|
||||
#include "dct32.h"
|
||||
|
||||
static AVOnce mpadsp_float_table_init = AV_ONCE_INIT;
|
||||
static AVOnce mpadsp_fixed_table_init = AV_ONCE_INIT;
|
||||
|
||||
av_cold void ff_mpadsp_init(MPADSPContext *s)
|
||||
{
|
||||
DCTContext dct;
|
||||
|
||||
ff_dct_init(&dct, 5, DCT_II);
|
||||
ff_init_mpadsp_tabs_float();
|
||||
ff_init_mpadsp_tabs_fixed();
|
||||
ff_thread_once(&mpadsp_float_table_init, &ff_init_mpadsp_tabs_float);
|
||||
ff_thread_once(&mpadsp_fixed_table_init, &ff_init_mpadsp_tabs_fixed);
|
||||
|
||||
s->apply_window_float = ff_mpadsp_apply_window_float;
|
||||
s->apply_window_fixed = ff_mpadsp_apply_window_fixed;
|
||||
|
||||
@@ -181,6 +181,8 @@ static int decode_0(PAFVideoDecContext *c, uint8_t *pkt, uint8_t code)
|
||||
dend = c->frame[page] + c->frame_size;
|
||||
offset = (x & 0x7F) * 2;
|
||||
j = bytestream2_get_le16(&c->gb) + offset;
|
||||
if (bytestream2_get_bytes_left(&c->gb) < (j - offset) * 16)
|
||||
return AVERROR_INVALIDDATA;
|
||||
do {
|
||||
offset++;
|
||||
if (dst + 3 * c->width + 4 > dend)
|
||||
@@ -198,7 +200,8 @@ static int decode_0(PAFVideoDecContext *c, uint8_t *pkt, uint8_t code)
|
||||
do {
|
||||
set_src_position(c, &src, &send);
|
||||
if ((src + 3 * c->width + 4 > send) ||
|
||||
(dst + 3 * c->width + 4 > dend))
|
||||
(dst + 3 * c->width + 4 > dend) ||
|
||||
bytestream2_get_bytes_left(&c->gb) < 4)
|
||||
return AVERROR_INVALIDDATA;
|
||||
copy_block4(dst, src, c->width, c->width, 4);
|
||||
i++;
|
||||
|
||||
+1
-1
@@ -1366,7 +1366,7 @@ static int decode_frame_png(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
if ((ret = av_frame_ref(data, s->picture.f)) < 0)
|
||||
return ret;
|
||||
goto the_end;
|
||||
|
||||
*got_frame = 1;
|
||||
|
||||
|
||||
@@ -267,6 +267,8 @@ static int decode_picture_header(AVCodecContext *avctx, const uint8_t *buf, cons
|
||||
\
|
||||
if (q > switch_bits) { /* exp golomb */ \
|
||||
bits = exp_order - switch_bits + (q<<1); \
|
||||
if (bits > FFMIN(MIN_CACHE_BITS, 31)) \
|
||||
return AVERROR_INVALIDDATA; \
|
||||
val = SHOW_UBITS(re, gb, bits) - (1 << exp_order) + \
|
||||
((switch_bits + 1) << rice_order); \
|
||||
SKIP_BITS(re, gb, bits); \
|
||||
@@ -286,7 +288,7 @@ static int decode_picture_header(AVCodecContext *avctx, const uint8_t *buf, cons
|
||||
|
||||
static const uint8_t dc_codebook[7] = { 0x04, 0x28, 0x28, 0x4D, 0x4D, 0x70, 0x70};
|
||||
|
||||
static av_always_inline void decode_dc_coeffs(GetBitContext *gb, int16_t *out,
|
||||
static av_always_inline int decode_dc_coeffs(GetBitContext *gb, int16_t *out,
|
||||
int blocks_per_slice)
|
||||
{
|
||||
int16_t prev_dc;
|
||||
@@ -310,6 +312,7 @@ static av_always_inline void decode_dc_coeffs(GetBitContext *gb, int16_t *out,
|
||||
out[0] = prev_dc;
|
||||
}
|
||||
CLOSE_READER(re, gb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// adaptive codebook switching lut according to previous run/level values
|
||||
@@ -376,7 +379,8 @@ static int decode_slice_luma(AVCodecContext *avctx, SliceContext *slice,
|
||||
|
||||
init_get_bits(&gb, buf, buf_size << 3);
|
||||
|
||||
decode_dc_coeffs(&gb, blocks, blocks_per_slice);
|
||||
if ((ret = decode_dc_coeffs(&gb, blocks, blocks_per_slice)) < 0)
|
||||
return ret;
|
||||
if ((ret = decode_ac_coeffs(avctx, &gb, blocks, blocks_per_slice)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -409,7 +413,8 @@ static int decode_slice_chroma(AVCodecContext *avctx, SliceContext *slice,
|
||||
|
||||
init_get_bits(&gb, buf, buf_size << 3);
|
||||
|
||||
decode_dc_coeffs(&gb, blocks, blocks_per_slice);
|
||||
if ((ret = decode_dc_coeffs(&gb, blocks, blocks_per_slice)) < 0)
|
||||
return ret;
|
||||
if ((ret = decode_ac_coeffs(avctx, &gb, blocks, blocks_per_slice)) < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -233,12 +233,14 @@ static void sbr_hf_g_filt_c(int (*Y)[2], const int (*X_high)[40][2],
|
||||
int64_t accu;
|
||||
|
||||
for (m = 0; m < m_max; m++) {
|
||||
int64_t r = 1LL << (22-g_filt[m].exp);
|
||||
accu = (int64_t)X_high[m][ixh][0] * ((g_filt[m].mant + 0x40)>>7);
|
||||
Y[m][0] = (int)((accu + r) >> (23-g_filt[m].exp));
|
||||
if (22 - g_filt[m].exp < 61) {
|
||||
int64_t r = 1LL << (22-g_filt[m].exp);
|
||||
accu = (int64_t)X_high[m][ixh][0] * ((g_filt[m].mant + 0x40)>>7);
|
||||
Y[m][0] = (int)((accu + r) >> (23-g_filt[m].exp));
|
||||
|
||||
accu = (int64_t)X_high[m][ixh][1] * ((g_filt[m].mant + 0x40)>>7);
|
||||
Y[m][1] = (int)((accu + r) >> (23-g_filt[m].exp));
|
||||
accu = (int64_t)X_high[m][ixh][1] * ((g_filt[m].mant + 0x40)>>7);
|
||||
Y[m][1] = (int)((accu + r) >> (23-g_filt[m].exp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+22
-10
@@ -183,13 +183,22 @@ static int decode_q_branch(SnowContext *s, int level, int x, int y){
|
||||
int my_context= av_log2(2*FFABS(left->my - top->my)) + 0*av_log2(2*FFABS(tr->my - top->my));
|
||||
|
||||
type= get_rac(&s->c, &s->block_state[1 + left->type + top->type]) ? BLOCK_INTRA : 0;
|
||||
|
||||
if(type){
|
||||
int ld, cbd, crd;
|
||||
pred_mv(s, &mx, &my, 0, left, top, tr);
|
||||
l += get_symbol(&s->c, &s->block_state[32], 1);
|
||||
ld = get_symbol(&s->c, &s->block_state[32], 1);
|
||||
if (ld < -255 || ld > 255) {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
l += ld;
|
||||
if (s->nb_planes > 2) {
|
||||
cb+= get_symbol(&s->c, &s->block_state[64], 1);
|
||||
cr+= get_symbol(&s->c, &s->block_state[96], 1);
|
||||
cbd = get_symbol(&s->c, &s->block_state[64], 1);
|
||||
crd = get_symbol(&s->c, &s->block_state[96], 1);
|
||||
if (cbd < -255 || cbd > 255 || crd < -255 || crd > 255) {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
cb += cbd;
|
||||
cr += crd;
|
||||
}
|
||||
}else{
|
||||
if(s->ref_frames > 1)
|
||||
@@ -374,7 +383,7 @@ static int decode_header(SnowContext *s){
|
||||
}
|
||||
}
|
||||
|
||||
s->spatial_decomposition_type+= get_symbol(&s->c, s->header_state, 1);
|
||||
s->spatial_decomposition_type+= (unsigned)get_symbol(&s->c, s->header_state, 1);
|
||||
if(s->spatial_decomposition_type > 1U){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_type %d not supported\n", s->spatial_decomposition_type);
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -390,13 +399,14 @@ static int decode_header(SnowContext *s){
|
||||
}
|
||||
|
||||
|
||||
s->qlog += get_symbol(&s->c, s->header_state, 1);
|
||||
s->mv_scale += get_symbol(&s->c, s->header_state, 1);
|
||||
s->qbias += get_symbol(&s->c, s->header_state, 1);
|
||||
s->block_max_depth+= get_symbol(&s->c, s->header_state, 1);
|
||||
if(s->block_max_depth > 1 || s->block_max_depth < 0){
|
||||
s->qlog += (unsigned)get_symbol(&s->c, s->header_state, 1);
|
||||
s->mv_scale += (unsigned)get_symbol(&s->c, s->header_state, 1);
|
||||
s->qbias += (unsigned)get_symbol(&s->c, s->header_state, 1);
|
||||
s->block_max_depth+= (unsigned)get_symbol(&s->c, s->header_state, 1);
|
||||
if(s->block_max_depth > 1 || s->block_max_depth < 0 || s->mv_scale > 256U){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "block_max_depth= %d is too large\n", s->block_max_depth);
|
||||
s->block_max_depth= 0;
|
||||
s->mv_scale = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (FFABS(s->qbias) > 127) {
|
||||
@@ -427,6 +437,8 @@ static int decode_blocks(SnowContext *s){
|
||||
|
||||
for(y=0; y<h; y++){
|
||||
for(x=0; x<w; x++){
|
||||
if (s->c.bytestream >= s->c.bytestream_end)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if ((res = decode_q_branch(s, 0, x, y)) < 0)
|
||||
return res;
|
||||
}
|
||||
|
||||
+1
-1
@@ -285,7 +285,7 @@ static void svq3_add_idct_c(uint8_t *dst, int16_t *block,
|
||||
const unsigned z1 = 13 * (block[i + 4 * 0] - block[i + 4 * 2]);
|
||||
const unsigned z2 = 7 * block[i + 4 * 1] - 17 * block[i + 4 * 3];
|
||||
const unsigned z3 = 17 * block[i + 4 * 1] + 7 * block[i + 4 * 3];
|
||||
const int rr = (dc + 0x80000);
|
||||
const int rr = (dc + 0x80000u);
|
||||
|
||||
dst[i + stride * 0] = av_clip_uint8(dst[i + stride * 0] + ((int)((z0 + z3) * qmul + rr) >> 20));
|
||||
dst[i + stride * 1] = av_clip_uint8(dst[i + stride * 1] + ((int)((z1 + z2) * qmul + rr) >> 20));
|
||||
|
||||
+5
-5
@@ -206,7 +206,7 @@ static void decode_lpc(int32_t *coeffs, int mode, int length)
|
||||
int a1 = *coeffs++;
|
||||
for (i = 0; i < length - 1 >> 1; i++) {
|
||||
*coeffs += a1;
|
||||
coeffs[1] += *coeffs;
|
||||
coeffs[1] += (unsigned)*coeffs;
|
||||
a1 = coeffs[1];
|
||||
coeffs += 2;
|
||||
}
|
||||
@@ -486,10 +486,10 @@ static int decode_subframe(TAKDecContext *s, int32_t *decoded,
|
||||
v += (unsigned)s->adsp.scalarproduct_int16(&s->residues[i], s->filter,
|
||||
filter_order & -16);
|
||||
for (j = filter_order & -16; j < filter_order; j += 4) {
|
||||
v += s->residues[i + j + 3] * s->filter[j + 3] +
|
||||
s->residues[i + j + 2] * s->filter[j + 2] +
|
||||
s->residues[i + j + 1] * s->filter[j + 1] +
|
||||
s->residues[i + j ] * s->filter[j ];
|
||||
v += s->residues[i + j + 3] * (unsigned)s->filter[j + 3] +
|
||||
s->residues[i + j + 2] * (unsigned)s->filter[j + 2] +
|
||||
s->residues[i + j + 1] * (unsigned)s->filter[j + 1] +
|
||||
s->residues[i + j ] * (unsigned)s->filter[j ];
|
||||
}
|
||||
v = (av_clip_intp2(v >> filter_quant, 13) * (1 << dshift)) - (unsigned)*decoded;
|
||||
*decoded++ = v;
|
||||
|
||||
@@ -465,7 +465,7 @@ static inline void tm2_apply_deltas(TM2Context *ctx, int* Y, int stride, int *de
|
||||
}
|
||||
}
|
||||
|
||||
static inline void tm2_high_chroma(int *data, int stride, int *last, int *CD, int *deltas)
|
||||
static inline void tm2_high_chroma(int *data, int stride, int *last, unsigned *CD, int *deltas)
|
||||
{
|
||||
int i, j;
|
||||
for (j = 0; j < 2; j++) {
|
||||
|
||||
+3
-2
@@ -1171,7 +1171,7 @@ static av_cold int vc2_encode_init(AVCodecContext *avctx)
|
||||
p->dwt_width = w = FFALIGN(p->width, (1 << s->wavelet_depth));
|
||||
p->dwt_height = h = FFALIGN(p->height, (1 << s->wavelet_depth));
|
||||
p->coef_stride = FFALIGN(p->dwt_width, 32);
|
||||
p->coef_buf = av_malloc(p->coef_stride*p->dwt_height*sizeof(dwtcoef));
|
||||
p->coef_buf = av_mallocz(p->coef_stride*p->dwt_height*sizeof(dwtcoef));
|
||||
if (!p->coef_buf)
|
||||
goto alloc_fail;
|
||||
for (level = s->wavelet_depth-1; level >= 0; level--) {
|
||||
@@ -1190,7 +1190,8 @@ static av_cold int vc2_encode_init(AVCodecContext *avctx)
|
||||
/* DWT init */
|
||||
if (ff_vc2enc_init_transforms(&s->transform_args[i].t,
|
||||
s->plane[i].coef_stride,
|
||||
s->plane[i].dwt_height))
|
||||
s->plane[i].dwt_height,
|
||||
s->slice_width, s->slice_height))
|
||||
goto alloc_fail;
|
||||
}
|
||||
|
||||
|
||||
@@ -255,21 +255,27 @@ static void vc2_subband_dwt_haar_shift(VC2TransformContext *t, dwtcoef *data,
|
||||
dwt_haar(t, data, stride, width, height, 1);
|
||||
}
|
||||
|
||||
av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_width, int p_height)
|
||||
av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_stride,
|
||||
int p_height, int slice_w, int slice_h)
|
||||
{
|
||||
s->vc2_subband_dwt[VC2_TRANSFORM_9_7] = vc2_subband_dwt_97;
|
||||
s->vc2_subband_dwt[VC2_TRANSFORM_5_3] = vc2_subband_dwt_53;
|
||||
s->vc2_subband_dwt[VC2_TRANSFORM_HAAR] = vc2_subband_dwt_haar;
|
||||
s->vc2_subband_dwt[VC2_TRANSFORM_HAAR_S] = vc2_subband_dwt_haar_shift;
|
||||
|
||||
s->buffer = av_malloc(2*p_width*p_height*sizeof(dwtcoef));
|
||||
/* Pad by the slice size, only matters for non-Haar wavelets */
|
||||
s->buffer = av_calloc((p_stride + slice_w)*(p_height + slice_h), sizeof(dwtcoef));
|
||||
if (!s->buffer)
|
||||
return 1;
|
||||
|
||||
s->padding = (slice_h >> 1)*p_stride + (slice_w >> 1);
|
||||
s->buffer += s->padding;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
av_cold void ff_vc2enc_free_transforms(VC2TransformContext *s)
|
||||
{
|
||||
av_freep(&s->buffer);
|
||||
av_free(s->buffer - s->padding);
|
||||
s->buffer = NULL;
|
||||
}
|
||||
|
||||
@@ -41,12 +41,14 @@ enum VC2TransformType {
|
||||
|
||||
typedef struct VC2TransformContext {
|
||||
dwtcoef *buffer;
|
||||
int padding;
|
||||
void (*vc2_subband_dwt[VC2_TRANSFORMS_NB])(struct VC2TransformContext *t,
|
||||
dwtcoef *data, ptrdiff_t stride,
|
||||
int width, int height);
|
||||
} VC2TransformContext;
|
||||
|
||||
int ff_vc2enc_init_transforms(VC2TransformContext *t, int p_width, int p_height);
|
||||
int ff_vc2enc_init_transforms(VC2TransformContext *t, int p_stride, int p_height,
|
||||
int slice_w, int slice_h);
|
||||
void ff_vc2enc_free_transforms(VC2TransformContext *t);
|
||||
|
||||
#endif /* AVCODEC_VC2ENC_DWT_H */
|
||||
|
||||
+2
-2
@@ -67,7 +67,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
|
||||
if (bits[p] > 32)
|
||||
return AVERROR_INVALIDDATA;
|
||||
for (i = 0; i < bits[p]; ++i)
|
||||
exit_at_level[i+1] = 1 << i;
|
||||
exit_at_level[i+1] = 1u << i;
|
||||
|
||||
++p;
|
||||
|
||||
@@ -91,7 +91,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
|
||||
exit_at_level[i] = 0;
|
||||
// construct code (append 0s to end) and introduce new exits
|
||||
for (j = i + 1 ;j <= bits[p]; ++j)
|
||||
exit_at_level[j] = code + (1 << (j - 1));
|
||||
exit_at_level[j] = code + (1u << (j - 1));
|
||||
codes[p] = code;
|
||||
}
|
||||
|
||||
|
||||
+16
-2
@@ -30,7 +30,7 @@
|
||||
#include "wmv2.h"
|
||||
|
||||
|
||||
static void parse_mb_skip(Wmv2Context *w)
|
||||
static int parse_mb_skip(Wmv2Context *w)
|
||||
{
|
||||
int mb_x, mb_y;
|
||||
MpegEncContext *const s = &w->s;
|
||||
@@ -45,6 +45,8 @@ static void parse_mb_skip(Wmv2Context *w)
|
||||
MB_TYPE_16x16 | MB_TYPE_L0;
|
||||
break;
|
||||
case SKIP_TYPE_MPEG:
|
||||
if (get_bits_left(&s->gb) < s->mb_height * s->mb_width)
|
||||
return AVERROR_INVALIDDATA;
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++)
|
||||
for (mb_x = 0; mb_x < s->mb_width; mb_x++)
|
||||
mb_type[mb_y * s->mb_stride + mb_x] =
|
||||
@@ -52,6 +54,8 @@ static void parse_mb_skip(Wmv2Context *w)
|
||||
break;
|
||||
case SKIP_TYPE_ROW:
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
|
||||
if (get_bits_left(&s->gb) < 1)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (get_bits1(&s->gb)) {
|
||||
for (mb_x = 0; mb_x < s->mb_width; mb_x++)
|
||||
mb_type[mb_y * s->mb_stride + mb_x] =
|
||||
@@ -65,6 +69,8 @@ static void parse_mb_skip(Wmv2Context *w)
|
||||
break;
|
||||
case SKIP_TYPE_COL:
|
||||
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||
if (get_bits_left(&s->gb) < 1)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (get_bits1(&s->gb)) {
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++)
|
||||
mb_type[mb_y * s->mb_stride + mb_x] =
|
||||
@@ -77,6 +83,7 @@ static void parse_mb_skip(Wmv2Context *w)
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int decode_ext_header(Wmv2Context *w)
|
||||
@@ -170,9 +177,12 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
|
||||
}
|
||||
} else {
|
||||
int cbp_index;
|
||||
int ret;
|
||||
w->j_type = 0;
|
||||
|
||||
parse_mb_skip(w);
|
||||
ret = parse_mb_skip(w);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
cbp_index = decode012(&s->gb);
|
||||
w->cbp_table_index = wmv2_get_cbp_table_index(s, cbp_index);
|
||||
|
||||
@@ -359,6 +369,8 @@ int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
|
||||
w->hshift = 0;
|
||||
return 0;
|
||||
}
|
||||
if (get_bits_left(&s->gb) <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
code = get_vlc2(&s->gb, ff_mb_non_intra_vlc[w->cbp_table_index].table,
|
||||
MB_NON_INTRA_VLC_BITS, 3);
|
||||
@@ -369,6 +381,8 @@ int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
|
||||
cbp = code & 0x3f;
|
||||
} else {
|
||||
s->mb_intra = 1;
|
||||
if (get_bits_left(&s->gb) <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
|
||||
if (code < 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
|
||||
@@ -42,10 +42,11 @@ cglobal diff_bytes, 4,5,2, dst, src1, src2, w
|
||||
%define i t0q
|
||||
%endmacro
|
||||
|
||||
; label to jump to if w < regsize
|
||||
%macro DIFF_BYTES_LOOP_PREP 1
|
||||
; labels to jump to if w < regsize and w < 0
|
||||
%macro DIFF_BYTES_LOOP_PREP 2
|
||||
mov i, wq
|
||||
and i, -2 * regsize
|
||||
js %2
|
||||
jz %1
|
||||
add dstq, i
|
||||
add src1q, i
|
||||
@@ -86,8 +87,8 @@ cglobal diff_bytes, 4,5,2, dst, src1, src2, w
|
||||
jz .end_%1%2
|
||||
%if mmsize > 16
|
||||
; fall back to narrower xmm
|
||||
%define regsize mmsize / 2
|
||||
DIFF_BYTES_LOOP_PREP .setup_loop_gpr_aa
|
||||
%define regsize (mmsize / 2)
|
||||
DIFF_BYTES_LOOP_PREP .setup_loop_gpr_aa, .end_aa
|
||||
.loop2_%1%2:
|
||||
DIFF_BYTES_LOOP_CORE %1, %2, xm0, xm1
|
||||
add i, 2 * regsize
|
||||
@@ -114,7 +115,7 @@ cglobal diff_bytes, 4,5,2, dst, src1, src2, w
|
||||
INIT_MMX mmx
|
||||
DIFF_BYTES_PROLOGUE
|
||||
%define regsize mmsize
|
||||
DIFF_BYTES_LOOP_PREP .skip_main_aa
|
||||
DIFF_BYTES_LOOP_PREP .skip_main_aa, .end_aa
|
||||
DIFF_BYTES_BODY a, a
|
||||
%undef i
|
||||
%endif
|
||||
@@ -122,7 +123,7 @@ DIFF_BYTES_PROLOGUE
|
||||
INIT_XMM sse2
|
||||
DIFF_BYTES_PROLOGUE
|
||||
%define regsize mmsize
|
||||
DIFF_BYTES_LOOP_PREP .skip_main_aa
|
||||
DIFF_BYTES_LOOP_PREP .skip_main_aa, .end_aa
|
||||
test dstq, regsize - 1
|
||||
jnz .loop_uu
|
||||
test src1q, regsize - 1
|
||||
@@ -138,7 +139,7 @@ DIFF_BYTES_PROLOGUE
|
||||
%define regsize mmsize
|
||||
; Directly using unaligned SSE2 version is marginally faster than
|
||||
; branching based on arguments.
|
||||
DIFF_BYTES_LOOP_PREP .skip_main_uu
|
||||
DIFF_BYTES_LOOP_PREP .skip_main_uu, .end_uu
|
||||
test dstq, regsize - 1
|
||||
jnz .loop_uu
|
||||
test src1q, regsize - 1
|
||||
|
||||
@@ -52,8 +52,9 @@ static void gmc_mmx(uint8_t *dst, uint8_t *src,
|
||||
const int dyh = (dyy - (1 << (16 + shift))) * (h - 1);
|
||||
const int dxh = dxy * (h - 1);
|
||||
const int dyw = dyx * (w - 1);
|
||||
int need_emu = (unsigned) ix >= width - w ||
|
||||
(unsigned) iy >= height - h;
|
||||
int need_emu = (unsigned) ix >= width - w || width < w ||
|
||||
(unsigned) iy >= height - h || height< h
|
||||
;
|
||||
|
||||
if ( // non-constant fullpel offset (3% of blocks)
|
||||
((ox ^ (ox + dxw)) | (ox ^ (ox + dxh)) | (ox ^ (ox + dxw + dxh)) |
|
||||
|
||||
+5
-2
@@ -131,7 +131,10 @@ static int xan_huffman_decode(uint8_t *dest, int dest_len,
|
||||
return ret;
|
||||
|
||||
while (val != 0x16) {
|
||||
unsigned idx = val - 0x17 + get_bits1(&gb) * byte;
|
||||
unsigned idx;
|
||||
if (get_bits_left(&gb) < 1)
|
||||
return AVERROR_INVALIDDATA;
|
||||
idx = val - 0x17 + get_bits1(&gb) * byte;
|
||||
if (idx >= 2 * byte)
|
||||
return AVERROR_INVALIDDATA;
|
||||
val = src[idx];
|
||||
@@ -263,7 +266,7 @@ static inline void xan_wc3_copy_pixel_run(XanContext *s, AVFrame *frame,
|
||||
prevframe_index = (y + motion_y) * stride + x + motion_x;
|
||||
prevframe_x = x + motion_x;
|
||||
|
||||
if (prev_palette_plane == palette_plane && FFABS(curframe_index - prevframe_index) < pixel_count) {
|
||||
if (prev_palette_plane == palette_plane && FFABS(motion_x + width*motion_y) < pixel_count) {
|
||||
avpriv_request_sample(s->avctx, "Overlapping copy");
|
||||
return ;
|
||||
}
|
||||
|
||||
@@ -539,6 +539,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
} else {
|
||||
frame->key_frame = 0;
|
||||
frame->pict_type = AV_PICTURE_TYPE_P;
|
||||
if (c->decomp_len < 2LL * ((c->width + c->bw - 1) / c->bw) * ((c->height + c->bh - 1) / c->bh))
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (c->decomp_len)
|
||||
c->decode_xor(c);
|
||||
}
|
||||
|
||||
+10
-10
@@ -28,7 +28,7 @@
|
||||
typedef struct DCShiftContext {
|
||||
const AVClass *class;
|
||||
double dcshift;
|
||||
double limiterthreshhold;
|
||||
double limiterthreshold;
|
||||
double limitergain;
|
||||
} DCShiftContext;
|
||||
|
||||
@@ -47,7 +47,7 @@ static av_cold int init(AVFilterContext *ctx)
|
||||
{
|
||||
DCShiftContext *s = ctx->priv;
|
||||
|
||||
s->limiterthreshhold = INT32_MAX * (1.0 - (fabs(s->dcshift) - s->limitergain));
|
||||
s->limiterthreshold = INT32_MAX * (1.0 - (fabs(s->dcshift) - s->limitergain));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -106,14 +106,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
|
||||
d = src[j];
|
||||
|
||||
if (d > s->limiterthreshhold && dcshift > 0) {
|
||||
d = (d - s->limiterthreshhold) * s->limitergain /
|
||||
(INT32_MAX - s->limiterthreshhold) +
|
||||
s->limiterthreshhold + dcshift;
|
||||
} else if (d < -s->limiterthreshhold && dcshift < 0) {
|
||||
d = (d + s->limiterthreshhold) * s->limitergain /
|
||||
(INT32_MAX - s->limiterthreshhold) -
|
||||
s->limiterthreshhold + dcshift;
|
||||
if (d > s->limiterthreshold && dcshift > 0) {
|
||||
d = (d - s->limiterthreshold) * s->limitergain /
|
||||
(INT32_MAX - s->limiterthreshold) +
|
||||
s->limiterthreshold + dcshift;
|
||||
} else if (d < -s->limiterthreshold && dcshift < 0) {
|
||||
d = (d + s->limiterthreshold) * s->limitergain /
|
||||
(INT32_MAX - s->limiterthreshold) -
|
||||
s->limiterthreshold + dcshift;
|
||||
} else {
|
||||
d = dcshift * INT32_MAX + d;
|
||||
}
|
||||
|
||||
@@ -166,6 +166,7 @@ static av_cold int init(AVFilterContext *ctx)
|
||||
goto fail;
|
||||
}
|
||||
/* gains */
|
||||
sign = 1;
|
||||
while (1) {
|
||||
gain = 1;
|
||||
if (sscanf(arg, "%lf%n *%n", &gain, &len, &len))
|
||||
|
||||
@@ -72,7 +72,7 @@ do {
|
||||
for (j = 0; j < b->nb; j++) \
|
||||
if (a->fmts[i] == b->fmts[j]) { \
|
||||
if(k >= FFMIN(a->nb, b->nb)){ \
|
||||
av_log(NULL, AV_LOG_ERROR, "Duplicate formats in avfilter_merge_formats() detected\n"); \
|
||||
av_log(NULL, AV_LOG_ERROR, "Duplicate formats in %s detected\n", __FUNCTION__); \
|
||||
av_free(ret->fmts); \
|
||||
av_free(ret); \
|
||||
return NULL; \
|
||||
|
||||
+2
-2
@@ -688,9 +688,9 @@ static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len, const cha
|
||||
}
|
||||
|
||||
if (decode_str(s, pb, 0, &dst, &len) < 0)
|
||||
return;
|
||||
goto end;
|
||||
if (len < 16)
|
||||
return;
|
||||
goto end;
|
||||
|
||||
start = avio_rb32(pb);
|
||||
end = avio_rb32(pb);
|
||||
|
||||
+8
-2
@@ -2411,6 +2411,8 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
avio_rb24(pb); /* flags */
|
||||
|
||||
entries = avio_rb32(pb);
|
||||
if ((uint64_t)entries * 12 + 4 > atom.size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
av_log(c->fc, AV_LOG_TRACE, "track[%u].stsc.entries = %u\n", c->fc->nb_streams - 1, entries);
|
||||
|
||||
@@ -3294,6 +3296,7 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
|
||||
// Free the old index and the old CTTS structures
|
||||
av_free(e_old);
|
||||
av_free(ctts_data_old);
|
||||
av_freep(&frame_duration_buffer);
|
||||
|
||||
// Null terminate the index ranges array
|
||||
current_index_range++;
|
||||
@@ -6169,6 +6172,7 @@ static int should_retry(AVIOContext *pb, int error_code) {
|
||||
|
||||
static int mov_switch_root(AVFormatContext *s, int64_t target)
|
||||
{
|
||||
int ret;
|
||||
MOVContext *mov = s->priv_data;
|
||||
int i, j;
|
||||
int already_read = 0;
|
||||
@@ -6205,8 +6209,10 @@ static int mov_switch_root(AVFormatContext *s, int64_t target)
|
||||
|
||||
mov->found_mdat = 0;
|
||||
|
||||
if (mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
|
||||
avio_feof(s->pb))
|
||||
ret = mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX });
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (avio_feof(s->pb))
|
||||
return AVERROR_EOF;
|
||||
av_log(s, AV_LOG_TRACE, "read fragments, offset 0x%"PRIx64"\n", avio_tell(s->pb));
|
||||
|
||||
|
||||
@@ -719,8 +719,10 @@ static int ogg_read_header(AVFormatContext *s)
|
||||
"Headers mismatch for stream %d: "
|
||||
"expected %d received %d.\n",
|
||||
i, os->codec->nb_header, os->nb_header);
|
||||
if (s->error_recognition & AV_EF_EXPLODE)
|
||||
if (s->error_recognition & AV_EF_EXPLODE) {
|
||||
ogg_read_close(s);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
if (os->start_granule != OGG_NOGRANULE_VALUE)
|
||||
os->lastpts = s->streams[i]->start_time =
|
||||
|
||||
@@ -125,7 +125,7 @@ static int vp8_packet(AVFormatContext *s, int idx)
|
||||
os->lastdts = vp8_gptopts(s, idx, os->granule, NULL) - duration;
|
||||
if(s->streams[idx]->start_time == AV_NOPTS_VALUE) {
|
||||
s->streams[idx]->start_time = os->lastpts;
|
||||
if (s->streams[idx]->duration)
|
||||
if (s->streams[idx]->duration && s->streams[idx]->duration != AV_NOPTS_VALUE)
|
||||
s->streams[idx]->duration -= s->streams[idx]->start_time;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-8
@@ -1732,13 +1732,14 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
|
||||
|
||||
if (next_pkt->dts != AV_NOPTS_VALUE) {
|
||||
int wrap_bits = s->streams[next_pkt->stream_index]->pts_wrap_bits;
|
||||
av_assert2(wrap_bits <= 64);
|
||||
// last dts seen for this stream. if any of packets following
|
||||
// current one had no dts, we will set this to AV_NOPTS_VALUE.
|
||||
int64_t last_dts = next_pkt->dts;
|
||||
while (pktl && next_pkt->pts == AV_NOPTS_VALUE) {
|
||||
if (pktl->pkt.stream_index == next_pkt->stream_index &&
|
||||
(av_compare_mod(next_pkt->dts, pktl->pkt.dts, 2LL << (wrap_bits - 1)) < 0)) {
|
||||
if (av_compare_mod(pktl->pkt.pts, pktl->pkt.dts, 2LL << (wrap_bits - 1))) {
|
||||
av_compare_mod(next_pkt->dts, pktl->pkt.dts, 2ULL << (wrap_bits - 1)) < 0) {
|
||||
if (av_compare_mod(pktl->pkt.pts, pktl->pkt.dts, 2ULL << (wrap_bits - 1))) {
|
||||
// not B-frame
|
||||
next_pkt->pts = pktl->pkt.dts;
|
||||
}
|
||||
@@ -3763,12 +3764,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
}
|
||||
|
||||
// close codecs which were opened in try_decode_frame()
|
||||
for (i = 0; i < ic->nb_streams; i++) {
|
||||
st = ic->streams[i];
|
||||
avcodec_close(st->internal->avctx);
|
||||
}
|
||||
|
||||
ff_rfps_calculate(ic);
|
||||
|
||||
for (i = 0; i < ic->nb_streams; i++) {
|
||||
@@ -3949,6 +3944,7 @@ find_stream_info_err:
|
||||
st = ic->streams[i];
|
||||
if (st->info)
|
||||
av_freep(&st->info->duration_error);
|
||||
avcodec_close(ic->streams[i]->internal->avctx);
|
||||
av_freep(&ic->streams[i]->info);
|
||||
}
|
||||
if (ic->pb)
|
||||
|
||||
@@ -43,6 +43,7 @@ static const SoftFloat FLOAT_EPSILON = { 0x29F16B12, -16};
|
||||
static const SoftFloat FLOAT_1584893192 = { 0x32B771ED, 1}; ///< 1.584893192 (10^.2)
|
||||
static const SoftFloat FLOAT_100000 = { 0x30D40000, 17}; ///< 100000
|
||||
static const SoftFloat FLOAT_0999999 = { 0x3FFFFBCE, 0}; ///< 0.999999
|
||||
static const SoftFloat FLOAT_MIN = { 0x20000000, MIN_EXP};
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -107,4 +107,6 @@ int main(int argc, char **argv){
|
||||
}
|
||||
}
|
||||
printf("presig: %d postsig:%d c:%7.4f lenerr:%d\n", bestpos, datlen - siglen - bestpos, bestc / sigamp, datlen - siglen);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
0c9639f09decbc54c9f091dcf1ca0e8f *ff-test_h.avi
|
||||
e28ba75853caf975e06d92955c9f7f73 *ff-test_l.avi
|
||||
a767dbdf5d1bded3450279f812f97b37 *ff-test.swf
|
||||
dc16f607e13328a832e73801cd21ec98 *ff-test_h.asf
|
||||
69337d6c8cd7ac7e626338decdbf41d3 *ff-test_l.asf
|
||||
ca209a0c67afbd3bc3bcde0840f313fc *ff-test_h.asf
|
||||
f97a91609bfc8a1857455f17c5ec101c *ff-test_l.asf
|
||||
06f5a6a4c5d1c6735f4d0068e825c91f *ff-test_h.rm
|
||||
1f57580f02f0317407b3b82a3d5e093f *ff-test_l.rm
|
||||
4c887dfc1dd0f6ea1a3a2be6dd32e495 *ff-test.jpg
|
||||
1d04b73b04aad27793cc762d5afabac1 *ff-test_small.jpg
|
||||
bc36c40ee34ebee6ffe50f3094aab733 *ff-test.mjpg
|
||||
e04e6ebf9584654df131f5eec881ac38 *ff-test.jpg
|
||||
f15d43e9d3630601b61a024023249bb8 *ff-test_small.jpg
|
||||
4735c72cde67000f12e9d1dbfbd975a7 *ff-test.mjpg
|
||||
fd038af80560e15271ce42651093ee43 *ff-stat
|
||||
|
||||
Reference in New Issue
Block a user