Compare commits
45 Commits
n0.7.16
...
release/0.7
| Author | SHA1 | Date | |
|---|---|---|---|
| 9526ad4f25 | |||
| 6f4cda4a6b | |||
| 98b0751e89 | |||
| a83b9f363c | |||
| 5333edcc86 | |||
| bd92af66a1 | |||
| c681f86a32 | |||
| 1979bfecc7 | |||
| 2ddabbb40f | |||
| 20446996f3 | |||
| 286915cb84 | |||
| 2b8c9c1f7d | |||
| 3eb6eeaab0 | |||
| f3a776a943 | |||
| 75b0cfcf10 | |||
| c68fe8ac8b | |||
| a58b8e99c4 | |||
| 42b4ba4a8a | |||
| 8cf62b34e4 | |||
| 127a290253 | |||
| 42f8a33c3c | |||
| ae82abbbcf | |||
| fac6f744d8 | |||
| 1aedd7645a | |||
| 9f993d2d4b | |||
| cb1db92cca | |||
| 30e8a37590 | |||
| f78f7eca1a | |||
| f3cdeeb070 | |||
| 79891f5b87 | |||
| 5b2097626d | |||
| faf293a83a | |||
| ef32bc8dde | |||
| fd36238c40 | |||
| 7a5590ef42 | |||
| 73962e677d | |||
| cd3c4d8c55 | |||
| b5e661bcd2 | |||
| 794fcabfe8 | |||
| 3ab6c0c4ec | |||
| 1b291e0466 | |||
| c3ece52dec | |||
| 0701f7c5c3 | |||
| cce6bdc758 | |||
| 1049328cf0 |
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 0.7.16
|
||||
PROJECT_NUMBER = 0.7.17
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@@ -8,7 +8,6 @@ FFmpeg code.
|
||||
Project Leader
|
||||
==============
|
||||
|
||||
Michael Niedermayer
|
||||
final design decisions
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ AVFormatContext *avformat_opts;
|
||||
struct SwsContext *sws_opts;
|
||||
AVDictionary *format_opts, *video_opts, *audio_opts, *sub_opts;
|
||||
|
||||
static const int this_year = 2013;
|
||||
static const int this_year = 2015;
|
||||
|
||||
void init_opts(void)
|
||||
{
|
||||
|
||||
@@ -2799,6 +2799,7 @@ if enabled asm; then
|
||||
fi
|
||||
|
||||
check_ldflags -Wl,--as-needed
|
||||
check_ldflags -Wl,-z,noexecstack
|
||||
|
||||
if check_func dlopen; then
|
||||
ldl=
|
||||
|
||||
@@ -55,9 +55,13 @@ static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
|
||||
for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {
|
||||
for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {
|
||||
if(x < width && y < height) {
|
||||
/* build average over 2 pixels */
|
||||
luma = (src[(x + 0 + y * p->linesize[0])] +
|
||||
src[(x + 1 + y * p->linesize[0])]) / 2;
|
||||
if (x + 1 < width) {
|
||||
/* build average over 2 pixels */
|
||||
luma = (src[(x + 0 + y * p->linesize[0])] +
|
||||
src[(x + 1 + y * p->linesize[0])]) / 2;
|
||||
} else {
|
||||
luma = src[(x + y * p->linesize[0])];
|
||||
}
|
||||
/* write blocks as linear data now so they are suitable for elbg */
|
||||
dest[0] = luma;
|
||||
}
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ static void put_audio_specific_config(AVCodecContext *avctx)
|
||||
PutBitContext pb;
|
||||
AACEncContext *s = avctx->priv_data;
|
||||
|
||||
init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
|
||||
init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
|
||||
put_bits(&pb, 5, 2); //object type - AAC-LC
|
||||
put_bits(&pb, 4, s->samplerate_index); //sample rate index
|
||||
put_bits(&pb, 4, avctx->channels);
|
||||
|
||||
@@ -67,10 +67,10 @@ function ff_scalarproduct_int16_neon, export=1
|
||||
|
||||
3: vpadd.s32 d16, d0, d1
|
||||
vpadd.s32 d17, d2, d3
|
||||
vpadd.s32 d10, d4, d5
|
||||
vpadd.s32 d11, d6, d7
|
||||
vpadd.s32 d18, d4, d5
|
||||
vpadd.s32 d19, d6, d7
|
||||
vpadd.s32 d0, d16, d17
|
||||
vpadd.s32 d1, d10, d11
|
||||
vpadd.s32 d1, d18, d19
|
||||
vpadd.s32 d2, d0, d1
|
||||
vpaddl.s32 d3, d2
|
||||
vmov.32 r0, d3[0]
|
||||
@@ -107,10 +107,10 @@ function ff_scalarproduct_and_madd_int16_neon, export=1
|
||||
|
||||
vpadd.s32 d16, d0, d1
|
||||
vpadd.s32 d17, d2, d3
|
||||
vpadd.s32 d10, d4, d5
|
||||
vpadd.s32 d11, d6, d7
|
||||
vpadd.s32 d18, d4, d5
|
||||
vpadd.s32 d19, d6, d7
|
||||
vpadd.s32 d0, d16, d17
|
||||
vpadd.s32 d1, d10, d11
|
||||
vpadd.s32 d1, d18, d19
|
||||
vpadd.s32 d2, d0, d1
|
||||
vpaddl.s32 d3, d2
|
||||
vmov.32 r0, d3[0]
|
||||
|
||||
@@ -151,7 +151,7 @@ static int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias)
|
||||
|
||||
static int dnxhd_init_rc(DNXHDEncContext *ctx)
|
||||
{
|
||||
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160*ctx->m.avctx->qmax*sizeof(RCEntry), fail);
|
||||
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160*(ctx->m.avctx->qmax + 1)*sizeof(RCEntry), fail);
|
||||
if (ctx->m.avctx->mb_decision != FF_MB_DECISION_RD)
|
||||
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_cmp, ctx->m.mb_num*sizeof(RCCMPEntry), fail);
|
||||
|
||||
|
||||
@@ -295,6 +295,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
c->avctx = avctx;
|
||||
avctx->pix_fmt = PIX_FMT_PAL8;
|
||||
|
||||
if (avctx->width%4 || avctx->height%4) {
|
||||
av_log(avctx, AV_LOG_ERROR, "dimensions are not a multiple of 4");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
avcodec_get_frame_defaults(&c->pic);
|
||||
avcodec_get_frame_defaults(&c->prev);
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ static void put_line(uint8_t *dst, int size, int width, const int *runs)
|
||||
PutBitContext pb;
|
||||
int run, mode = ~0, pix_left = width, run_idx = 0;
|
||||
|
||||
init_put_bits(&pb, dst, size*8);
|
||||
init_put_bits(&pb, dst, size);
|
||||
while(pix_left > 0){
|
||||
run = runs[run_idx++];
|
||||
mode = ~mode;
|
||||
|
||||
@@ -646,7 +646,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
handle_error:
|
||||
*poutbuf = NULL;
|
||||
*poutbuf_size = 0;
|
||||
return read_end - buf;
|
||||
return buf_size ? read_end - buf : 0;
|
||||
}
|
||||
|
||||
static int flac_parse_init(AVCodecParserContext *c)
|
||||
|
||||
@@ -270,7 +270,7 @@ static int write_header(FlashSV2Context * s, uint8_t * buf, int buf_size)
|
||||
if (buf_size < 5)
|
||||
return -1;
|
||||
|
||||
init_put_bits(&pb, buf, buf_size * 8);
|
||||
init_put_bits(&pb, buf, buf_size);
|
||||
|
||||
put_bits(&pb, 4, (s->block_width >> 4) - 1);
|
||||
put_bits(&pb, 12, s->image_width);
|
||||
|
||||
@@ -139,7 +139,7 @@ static int encode_bitstream(FlashSVContext *s, AVFrame *p, uint8_t *buf,
|
||||
int buf_pos, res;
|
||||
int pred_blocks = 0;
|
||||
|
||||
init_put_bits(&pb, buf, buf_size * 8);
|
||||
init_put_bits(&pb, buf, buf_size);
|
||||
|
||||
put_bits(&pb, 4, (block_width / 16) - 1);
|
||||
put_bits(&pb, 12, s->image_width);
|
||||
|
||||
+5
-10
@@ -125,26 +125,21 @@ static int gif_read_image(GifState *s)
|
||||
case 1:
|
||||
y1 += 8;
|
||||
ptr += linesize * 8;
|
||||
if (y1 >= height) {
|
||||
y1 = pass ? 2 : 4;
|
||||
ptr = ptr1 + linesize * y1;
|
||||
pass++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
y1 += 4;
|
||||
ptr += linesize * 4;
|
||||
if (y1 >= height) {
|
||||
y1 = 1;
|
||||
ptr = ptr1 + linesize;
|
||||
pass++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
y1 += 2;
|
||||
ptr += linesize * 2;
|
||||
break;
|
||||
}
|
||||
while (y1 >= height) {
|
||||
y1 = 4 >> pass;
|
||||
ptr = ptr1 + linesize * y1;
|
||||
pass++;
|
||||
}
|
||||
} else {
|
||||
ptr += linesize;
|
||||
}
|
||||
|
||||
@@ -1701,7 +1701,7 @@ static av_always_inline void decode_cabac_residual_internal( H264Context *h, DCT
|
||||
\
|
||||
if( coeff_abs >= 15 ) { \
|
||||
int j = 0; \
|
||||
while( get_cabac_bypass( CC ) ) { \
|
||||
while(get_cabac_bypass( CC ) && j<30) { \
|
||||
j++; \
|
||||
} \
|
||||
\
|
||||
|
||||
@@ -357,7 +357,9 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
|
||||
}
|
||||
sps->bit_depth_luma = get_ue_golomb(&s->gb) + 8;
|
||||
sps->bit_depth_chroma = get_ue_golomb(&s->gb) + 8;
|
||||
if (sps->bit_depth_luma > 12U || sps->bit_depth_chroma > 12U) {
|
||||
if (sps->bit_depth_luma < 8 || sps->bit_depth_luma > 12 ||
|
||||
sps->bit_depth_chroma < 8 || sps->bit_depth_chroma > 12 ||
|
||||
sps->bit_depth_luma != sps->bit_depth_chroma) {
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
|
||||
sps->bit_depth_luma, sps->bit_depth_chroma);
|
||||
goto fail;
|
||||
|
||||
@@ -203,6 +203,11 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
|
||||
x += stride;
|
||||
}
|
||||
|
||||
if (x >= w) {
|
||||
av_log(NULL, AV_LOG_ERROR, "run overflow\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* decode run termination value */
|
||||
Rb = R(last, x);
|
||||
RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;
|
||||
|
||||
+51
-24
@@ -212,16 +212,16 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
|
||||
|
||||
int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
{
|
||||
int len, nb_components, i, width, height, pix_fmt_id;
|
||||
int len, nb_components, i, width, height, bits, pix_fmt_id;
|
||||
|
||||
/* XXX: verify len field validity */
|
||||
len = get_bits(&s->gb, 16);
|
||||
s->bits= get_bits(&s->gb, 8);
|
||||
bits= get_bits(&s->gb, 8);
|
||||
|
||||
if(s->pegasus_rct) s->bits=9;
|
||||
if(s->bits==9 && !s->pegasus_rct) s->rct=1; //FIXME ugly
|
||||
if(s->pegasus_rct) bits=9;
|
||||
if(bits==9 && !s->pegasus_rct) s->rct=1; //FIXME ugly
|
||||
|
||||
if (s->bits != 8 && !s->lossless){
|
||||
if (bits != 8 && !s->lossless){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "only 8 bits/component accepted\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -241,7 +241,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
if (nb_components <= 0 ||
|
||||
nb_components > MAX_COMPONENTS)
|
||||
return -1;
|
||||
if (s->ls && !(s->bits <= 8 || nb_components == 1)){
|
||||
if (s->ls && !(bits <= 8 || nb_components == 1)){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "only <= 8 bits/component or 16-bit gray accepted for JPEG-LS\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -274,11 +274,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
|
||||
/* if different size, realloc/alloc picture */
|
||||
/* XXX: also check h_count and v_count */
|
||||
if (width != s->width || height != s->height) {
|
||||
if ( width != s->width || height != s->height
|
||||
|| bits != s->bits
|
||||
) {
|
||||
av_freep(&s->qscale_table);
|
||||
|
||||
s->width = width;
|
||||
s->height = height;
|
||||
s->bits = bits;
|
||||
s->interlaced = 0;
|
||||
|
||||
/* test interlaced mode */
|
||||
@@ -344,9 +347,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
return -1;
|
||||
}
|
||||
if(s->ls){
|
||||
if(s->nb_components > 1)
|
||||
if(s->nb_components == 3) {
|
||||
s->avctx->pix_fmt = PIX_FMT_RGB24;
|
||||
else if(s->bits <= 8)
|
||||
} else if (s->nb_components != 1) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Unsupported number of components %d\n", s->nb_components);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
} else if (s->bits <= 8)
|
||||
s->avctx->pix_fmt = PIX_FMT_GRAY8;
|
||||
else
|
||||
s->avctx->pix_fmt = PIX_FMT_GRAY16;
|
||||
@@ -853,19 +859,28 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, i
|
||||
|
||||
if(s->interlaced && s->bottom_field)
|
||||
block_offset += linesize[c] >> 1;
|
||||
ptr = data[c] + block_offset;
|
||||
if(!s->progressive) {
|
||||
if ( 8*(h * mb_x + x) < s->width
|
||||
&& 8*(v * mb_y + y) < s->height) {
|
||||
ptr = data[c] + block_offset;
|
||||
} else
|
||||
ptr = NULL;
|
||||
if (!s->progressive) {
|
||||
if (copy_mb) {
|
||||
mjpeg_copy_block(ptr, reference_data[c] + block_offset, linesize[c], s->avctx->lowres);
|
||||
if (ptr)
|
||||
mjpeg_copy_block(ptr, reference_data[c] + block_offset,
|
||||
linesize[c], s->avctx->lowres);
|
||||
} else {
|
||||
s->dsp.clear_block(s->block);
|
||||
if(decode_block(s, s->block, i,
|
||||
s->dc_index[i], s->ac_index[i],
|
||||
s->quant_matrixes[ s->quant_index[c] ]) < 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "error y=%d x=%d\n", mb_y, mb_x);
|
||||
return -1;
|
||||
}
|
||||
s->dsp.idct_put(ptr, linesize[c], s->block);
|
||||
s->dsp.clear_block(s->block);
|
||||
if (decode_block(s, s->block, i,
|
||||
s->dc_index[i], s->ac_index[i],
|
||||
s->quant_matrixes[s->quant_index[c]]) < 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"error y=%d x=%d\n", mb_y, mb_x);
|
||||
return -1;
|
||||
}
|
||||
if (ptr) {
|
||||
s->dsp.idct_put(ptr, linesize[c], s->block);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int block_idx = s->block_stride[c] * (v * mb_y + y) + (h * mb_x + x);
|
||||
@@ -1174,6 +1189,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
|
||||
}
|
||||
|
||||
if (id == AV_RL32("LJIF")){
|
||||
int rgb = s->rgb;
|
||||
int pegasus_rct = s->pegasus_rct;
|
||||
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
|
||||
av_log(s->avctx, AV_LOG_INFO, "Pegasus lossless jpeg header found\n");
|
||||
skip_bits(&s->gb, 16); /* version ? */
|
||||
@@ -1182,17 +1199,27 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
|
||||
skip_bits(&s->gb, 16); /* unknwon always 0? */
|
||||
switch( get_bits(&s->gb, 8)){
|
||||
case 1:
|
||||
s->rgb= 1;
|
||||
s->pegasus_rct=0;
|
||||
rgb = 1;
|
||||
pegasus_rct = 0;
|
||||
break;
|
||||
case 2:
|
||||
s->rgb= 1;
|
||||
s->pegasus_rct=1;
|
||||
rgb = 1;
|
||||
pegasus_rct = 1;
|
||||
break;
|
||||
default:
|
||||
av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace\n");
|
||||
}
|
||||
|
||||
len -= 9;
|
||||
if (s->got_picture)
|
||||
if (rgb != s->rgb || pegasus_rct != s->pegasus_rct) {
|
||||
av_log(s->avctx, AV_LOG_WARNING, "Mismatching LJIF tag\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
s->rgb = rgb;
|
||||
s->pegasus_rct = pegasus_rct;
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ static void mm_decode_intra(MmContext * s, int half_horiz, int half_vert, const
|
||||
|
||||
if (color) {
|
||||
memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
|
||||
if (half_vert)
|
||||
if (half_vert && y + half_vert < s->avctx->height)
|
||||
memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length);
|
||||
}
|
||||
x+= run_length;
|
||||
|
||||
@@ -287,7 +287,7 @@ static void encode_block(NellyMoserEncodeContext *s, unsigned char *output, int
|
||||
|
||||
apply_mdct(s);
|
||||
|
||||
init_put_bits(&pb, output, output_size * 8);
|
||||
init_put_bits(&pb, output, output_size);
|
||||
|
||||
i = 0;
|
||||
for (band = 0; band < NELLY_BANDS; band++) {
|
||||
|
||||
+9
-2
@@ -418,6 +418,12 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
case MKTAG('I', 'H', 'D', 'R'):
|
||||
if (length != 13)
|
||||
goto fail;
|
||||
|
||||
if (s->state & PNG_IDAT) {
|
||||
av_log(avctx, AV_LOG_ERROR, "IHDR after IDAT\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
s->width = bytestream_get_be32(&s->bytestream);
|
||||
s->height = bytestream_get_be32(&s->bytestream);
|
||||
if(av_image_check_size(s->width, s->height, 0, avctx)){
|
||||
@@ -463,7 +469,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
} else if (s->bit_depth == 16 &&
|
||||
s->color_type == PNG_COLOR_TYPE_RGB) {
|
||||
avctx->pix_fmt = PIX_FMT_RGB48BE;
|
||||
} else if (s->bit_depth == 1) {
|
||||
} else if (s->bit_depth == 1 && s->bits_per_pixel == 1) {
|
||||
avctx->pix_fmt = PIX_FMT_MONOBLACK;
|
||||
} else if (s->bit_depth == 8 &&
|
||||
s->color_type == PNG_COLOR_TYPE_PALETTE) {
|
||||
@@ -584,9 +590,10 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
int i, j;
|
||||
uint8_t *pd = s->current_picture->data[0];
|
||||
uint8_t *pd_last = s->last_picture->data[0];
|
||||
int ls = FFMIN(av_image_get_linesize(s->current_picture->format, s->width, 0), s->width * s->bpp);
|
||||
|
||||
for(j=0; j < s->height; j++) {
|
||||
for(i=0; i < s->width * s->bpp; i++) {
|
||||
for(i=0; i < ls; i++) {
|
||||
pd[i] += pd_last[i];
|
||||
}
|
||||
pd += s->image_linesize;
|
||||
|
||||
+1
-1
@@ -168,7 +168,7 @@ static void qpeg_decode_inter(const uint8_t *src, uint8_t *dst, int size,
|
||||
|
||||
/* check motion vector */
|
||||
if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
|
||||
(height - me_y - me_h < 0) || (height - me_y > orig_height) ||
|
||||
(height - me_y - me_h < 0) || (height - me_y >= orig_height) ||
|
||||
(filled + me_w > width) || (height - me_h < 0))
|
||||
av_log(NULL, AV_LOG_ERROR, "Bogus motion vector (%i,%i), block size %ix%i at %i,%i\n",
|
||||
me_x, me_y, me_w, me_h, filled, height);
|
||||
|
||||
@@ -941,6 +941,8 @@ static int roq_encode_init(AVCodecContext *avctx)
|
||||
|
||||
av_lfg_init(&enc->randctx, 1);
|
||||
|
||||
enc->avctx = avctx;
|
||||
|
||||
enc->framesSinceKeyframe = 0;
|
||||
if ((avctx->width & 0xf) || (avctx->height & 0xf)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n");
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ typedef struct SmcContext {
|
||||
row_ptr += stride * 4; \
|
||||
} \
|
||||
total_blocks--; \
|
||||
if (total_blocks < 0) \
|
||||
if (total_blocks < 0 + !!n_blocks) \
|
||||
{ \
|
||||
av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
|
||||
return; \
|
||||
|
||||
@@ -498,6 +498,13 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *
|
||||
default:
|
||||
av_log(s->avctx, AV_LOG_DEBUG, "Unknown or unsupported tag %d/0X%0X\n", tag, tag);
|
||||
}
|
||||
if (s->bpp > 64U) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"This format is not supported (bpp=%d, %d components)\n",
|
||||
s->bpp, count);
|
||||
s->bpp = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+6
-2
@@ -161,8 +161,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int l
|
||||
break;
|
||||
case PIX_FMT_YUV411P:
|
||||
case PIX_FMT_UYYVYY411:
|
||||
w_align=32;
|
||||
h_align=8;
|
||||
w_align = 32;
|
||||
h_align = 16 * 2;
|
||||
break;
|
||||
case PIX_FMT_YUV410P:
|
||||
if(s->codec_id == CODEC_ID_SVQ1){
|
||||
@@ -182,6 +182,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int l
|
||||
w_align = 4;
|
||||
h_align = 4;
|
||||
}
|
||||
if (s->codec_id == CODEC_ID_JV) {
|
||||
w_align = 8;
|
||||
h_align = 8;
|
||||
}
|
||||
break;
|
||||
case PIX_FMT_BGR24:
|
||||
if((s->codec_id == CODEC_ID_MSZH) || (s->codec_id == CODEC_ID_ZLIB)){
|
||||
|
||||
+1
-1
@@ -339,7 +339,7 @@ static void vmd_decode(VmdVideoContext *s)
|
||||
if (*pb++ == 0xFF)
|
||||
len = rle_unpack(pb, pb_end - pb, len, &dp[ofs], frame_width - ofs);
|
||||
else {
|
||||
if (pb_end - pb < len)
|
||||
if (ofs + len > frame_width || pb_end - pb < len)
|
||||
return;
|
||||
memcpy(&dp[ofs], pb, len);
|
||||
}
|
||||
|
||||
@@ -404,6 +404,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
offset &= ~3;
|
||||
if (offset > s->sfb_offsets[i][band - 1])
|
||||
s->sfb_offsets[i][band++] = offset;
|
||||
|
||||
if (offset >= subframe_len)
|
||||
break;
|
||||
}
|
||||
s->sfb_offsets[i][band - 1] = subframe_len;
|
||||
s->num_sfb[i] = band - 1;
|
||||
|
||||
@@ -129,8 +129,8 @@ static void mlp_filter_channel_x86(int32_t *state, const int32_t *coeff,
|
||||
FIRMUL (ff_mlp_firorder_6, 0x14 )
|
||||
FIRMUL (ff_mlp_firorder_5, 0x10 )
|
||||
FIRMUL (ff_mlp_firorder_4, 0x0c )
|
||||
FIRMULREG(ff_mlp_firorder_3, 0x08,10)
|
||||
FIRMULREG(ff_mlp_firorder_2, 0x04, 9)
|
||||
FIRMUL (ff_mlp_firorder_3, 0x08 )
|
||||
FIRMUL (ff_mlp_firorder_2, 0x04 )
|
||||
FIRMULREG(ff_mlp_firorder_1, 0x00, 8)
|
||||
LABEL_MANGLE(ff_mlp_firorder_0)":\n\t"
|
||||
"jmp *%6 \n\t"
|
||||
@@ -159,8 +159,6 @@ static void mlp_filter_channel_x86(int32_t *state, const int32_t *coeff,
|
||||
: /* 4*/"r"((x86_reg)mask), /* 5*/"r"(firjump),
|
||||
/* 6*/"r"(iirjump) , /* 7*/"c"(filter_shift)
|
||||
, /* 8*/"r"((int64_t)coeff[0])
|
||||
, /* 9*/"r"((int64_t)coeff[1])
|
||||
, /*10*/"r"((int64_t)coeff[2])
|
||||
: "rax", "rdx", "rsi"
|
||||
#else /* ARCH_X86_32 */
|
||||
/* 3*/"+m"(blocksize)
|
||||
|
||||
@@ -203,6 +203,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
|
||||
return offset1;
|
||||
offset += offset1;
|
||||
}
|
||||
if (offset < 0)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
offset1 = offset - pos;
|
||||
if (!s->must_flush &&
|
||||
offset1 >= 0 && offset1 <= (s->buf_end - s->buffer)) {
|
||||
|
||||
+1
-1
@@ -486,7 +486,7 @@ static int gxf_packet(AVFormatContext *s, AVPacket *pkt) {
|
||||
}
|
||||
|
||||
static int gxf_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) {
|
||||
int res = 0;
|
||||
int64_t res = 0;
|
||||
uint64_t pos;
|
||||
uint64_t maxlen = 100 * 1024 * 1024;
|
||||
AVStream *st = s->streams[0];
|
||||
|
||||
@@ -1676,6 +1676,7 @@ static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
|
||||
*/
|
||||
static void matroska_clear_queue(MatroskaDemuxContext *matroska)
|
||||
{
|
||||
matroska->prev_pkt = NULL;
|
||||
if (matroska->packets) {
|
||||
int n;
|
||||
for (n = 0; n < matroska->num_packets; n++) {
|
||||
|
||||
+7
-3
@@ -54,7 +54,7 @@ typedef struct {
|
||||
|
||||
static inline int64_t bs_get_v(uint8_t **bs)
|
||||
{
|
||||
int64_t v = 0;
|
||||
uint64_t v = 0;
|
||||
int br = 0;
|
||||
int c;
|
||||
|
||||
@@ -88,7 +88,7 @@ static int mpc8_probe(AVProbeData *p)
|
||||
size = bs_get_v(&bs);
|
||||
if (size < 2)
|
||||
return 0;
|
||||
if (bs + size - 2 >= bs_end)
|
||||
if (size >= bs_end - bs + 2)
|
||||
return AVPROBE_SCORE_MAX / 4 - 1; //seems to be valid MPC but no header yet
|
||||
if (header_found) {
|
||||
if (size < 11 || size > 28)
|
||||
@@ -105,7 +105,7 @@ static int mpc8_probe(AVProbeData *p)
|
||||
|
||||
static inline int64_t gb_get_v(GetBitContext *gb)
|
||||
{
|
||||
int64_t v = 0;
|
||||
uint64_t v = 0;
|
||||
int bits = 0;
|
||||
while(get_bits1(gb) && bits < 64-7){
|
||||
v <<= 7;
|
||||
@@ -204,6 +204,10 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
while(!url_feof(pb)){
|
||||
pos = avio_tell(pb);
|
||||
mpc8_get_chunk_header(pb, &tag, &size);
|
||||
if (size < 0) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid chunk length\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if(tag == TAG_STREAMHDR)
|
||||
break;
|
||||
mpc8_handle_chunk(s, tag, pos, size);
|
||||
|
||||
@@ -1240,7 +1240,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
|
||||
break;
|
||||
desc_len = get8(&p, desc_list_end);
|
||||
desc_end = p + desc_len;
|
||||
if (desc_end > desc_list_end)
|
||||
if (desc_len < 0 || desc_end > desc_list_end)
|
||||
break;
|
||||
|
||||
av_dlog(ts->stream, "tag: 0x%02x len=%d\n",
|
||||
|
||||
@@ -251,6 +251,8 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
memcpy(oldpal, pal, 768);
|
||||
size = avio_r8(s->pb);
|
||||
size = size * 4 - 1;
|
||||
if(size + 1 > frame_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame_size -= size;
|
||||
frame_size--;
|
||||
sz = 0;
|
||||
@@ -292,10 +294,12 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
/* if audio chunks are present, put them to stack and retrieve later */
|
||||
for(i = 0; i < 7; i++) {
|
||||
if(flags & 1) {
|
||||
int size;
|
||||
unsigned int size;
|
||||
uint8_t *tmpbuf;
|
||||
|
||||
size = avio_rl32(s->pb) - 4;
|
||||
if(size + 4LL > frame_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame_size -= size;
|
||||
frame_size -= 4;
|
||||
smk->curstream++;
|
||||
|
||||
@@ -174,6 +174,8 @@ static int thp_read_packet(AVFormatContext *s,
|
||||
pkt->stream_index = thp->video_stream_index;
|
||||
} else {
|
||||
ret = av_get_packet(pb, pkt, thp->audiosize);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret != thp->audiosize) {
|
||||
av_free_packet(pkt);
|
||||
return AVERROR(EIO);
|
||||
|
||||
+6
-4
@@ -1103,12 +1103,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
|
||||
if (pkt->dts != AV_NOPTS_VALUE) {
|
||||
// got DTS from the stream, update reference timestamp
|
||||
st->reference_dts = pkt->dts - pc->dts_ref_dts_delta * num / den;
|
||||
pkt->pts = pkt->dts + pc->pts_dts_delta * num / den;
|
||||
} else if (st->reference_dts != AV_NOPTS_VALUE) {
|
||||
// compute DTS based on reference timestamp
|
||||
pkt->dts = st->reference_dts + pc->dts_ref_dts_delta * num / den;
|
||||
pkt->pts = pkt->dts + pc->pts_dts_delta * num / den;
|
||||
}
|
||||
|
||||
if (st->reference_dts != AV_NOPTS_VALUE && pkt->pts == AV_NOPTS_VALUE)
|
||||
pkt->pts = pkt->dts + pc->pts_dts_delta * num / den;
|
||||
|
||||
if (pc->dts_sync_point > 0)
|
||||
st->reference_dts = pkt->dts; // new reference
|
||||
}
|
||||
@@ -2312,8 +2314,8 @@ static int get_std_framerate(int i){
|
||||
* And there are "variable" fps files this needs to detect as well.
|
||||
*/
|
||||
static int tb_unreliable(AVCodecContext *c){
|
||||
if( c->time_base.den >= 101L*c->time_base.num
|
||||
|| c->time_base.den < 5L*c->time_base.num
|
||||
if( c->time_base.den >= 101LL*c->time_base.num
|
||||
|| c->time_base.den < 5LL*c->time_base.num
|
||||
/* || c->codec_tag == AV_RL32("DIVX")
|
||||
|| c->codec_tag == AV_RL32("XVID")*/
|
||||
|| c->codec_id == CODEC_ID_MPEG2VIDEO
|
||||
|
||||
+1
-1
@@ -227,7 +227,7 @@ static int vqf_read_seek(AVFormatContext *s,
|
||||
{
|
||||
VqfContext *c = s->priv_data;
|
||||
AVStream *st;
|
||||
int ret;
|
||||
int64_t ret;
|
||||
int64_t pos;
|
||||
|
||||
st = s->streams[stream_index];
|
||||
|
||||
+7
-1
@@ -62,7 +62,13 @@ static inline int get_byte(LZOContext *c) {
|
||||
static inline int get_len(LZOContext *c, int x, int mask) {
|
||||
int cnt = x & mask;
|
||||
if (!cnt) {
|
||||
while (!(x = get_byte(c))) cnt += 255;
|
||||
while (!(x = get_byte(c))) {
|
||||
if (cnt >= INT_MAX - 1000) {
|
||||
c->error |= AV_LZO_ERROR;
|
||||
break;
|
||||
}
|
||||
cnt += 255;
|
||||
}
|
||||
cnt += mask + x;
|
||||
}
|
||||
return cnt;
|
||||
|
||||
@@ -1971,6 +1971,7 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui
|
||||
for (h=0; h < height; h++) {
|
||||
int w;
|
||||
|
||||
if (width >= 16)
|
||||
#if COMPILE_TEMPLATE_SSE2
|
||||
__asm__(
|
||||
"xor %%"REG_a", %%"REG_a" \n\t"
|
||||
|
||||
Reference in New Issue
Block a user