Compare commits
73 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
73bfb21672 | ||
![]() |
86dac9d6b1 | ||
![]() |
645a299132 | ||
![]() |
b8c5cd5b8d | ||
![]() |
e256506950 | ||
![]() |
3cb8490066 | ||
![]() |
8d0112d8fc | ||
![]() |
fdb05ff57b | ||
![]() |
676dff8c54 | ||
![]() |
95d6bd95b1 | ||
![]() |
c80c0b2637 | ||
![]() |
190e8b4283 | ||
![]() |
327b284b58 | ||
![]() |
c34ec56ea8 | ||
![]() |
2f4c2cc6d3 | ||
![]() |
9814419deb | ||
![]() |
facd212f4a | ||
![]() |
ec02afcb6e | ||
![]() |
81f80d7b48 | ||
![]() |
cbda382526 | ||
![]() |
03be529f39 | ||
![]() |
07dcf5b05a | ||
![]() |
aef0c97b45 | ||
![]() |
aa3b63a6a5 | ||
![]() |
9db3ed2583 | ||
![]() |
9d49f4e081 | ||
![]() |
7add0b0692 | ||
![]() |
097417299a | ||
![]() |
3a691185f7 | ||
![]() |
6b4fc845f5 | ||
![]() |
485f78be20 | ||
![]() |
21ebfcdd43 | ||
![]() |
5601f216bf | ||
![]() |
0a3371f382 | ||
![]() |
a1fec9d141 | ||
![]() |
2894f27761 | ||
![]() |
bbef5b0b86 | ||
![]() |
de84d683b2 | ||
![]() |
e9179e6673 | ||
![]() |
633461d8bb | ||
![]() |
77c20198bb | ||
![]() |
ad0c39c1f1 | ||
![]() |
3eee7e0db6 | ||
![]() |
e2e66f2f99 | ||
![]() |
b41bc71143 | ||
![]() |
1b9a62c357 | ||
![]() |
93c9f1b97c | ||
![]() |
e76a5a9c28 | ||
![]() |
9f650fb5fb | ||
![]() |
9e835572f8 | ||
![]() |
d7a8d07fd8 | ||
![]() |
a2dc8dcb66 | ||
![]() |
1beea3b859 | ||
![]() |
0baea332cb | ||
![]() |
396b47d2a7 | ||
![]() |
dec5586bc7 | ||
![]() |
c5587516ca | ||
![]() |
94bd579319 | ||
![]() |
eb6d64edef | ||
![]() |
b69c7f20e8 | ||
![]() |
31b697f19c | ||
![]() |
798b3ed3fb | ||
![]() |
62b0462e5f | ||
![]() |
789f433bc6 | ||
![]() |
3756b306a2 | ||
![]() |
ded9931d16 | ||
![]() |
c17da32ba2 | ||
![]() |
9841654c15 | ||
![]() |
42eaec076b | ||
![]() |
473281193b | ||
![]() |
11f98c83d1 | ||
![]() |
eb1aa871d4 | ||
![]() |
6222ee068e |
@@ -65,7 +65,7 @@ struct SwsContext *sws_opts;
|
|||||||
SwrContext *swr_opts;
|
SwrContext *swr_opts;
|
||||||
AVDictionary *format_opts, *codec_opts;
|
AVDictionary *format_opts, *codec_opts;
|
||||||
|
|
||||||
const int this_year = 2014;
|
const int this_year = 2015;
|
||||||
|
|
||||||
static FILE *report_file;
|
static FILE *report_file;
|
||||||
|
|
||||||
|
6
configure
vendored
6
configure
vendored
@@ -1365,6 +1365,7 @@ HAVE_LIST="
|
|||||||
alsa_asoundlib_h
|
alsa_asoundlib_h
|
||||||
altivec_h
|
altivec_h
|
||||||
arpa_inet_h
|
arpa_inet_h
|
||||||
|
as_object_arch
|
||||||
asm_mod_q
|
asm_mod_q
|
||||||
asm_mod_y
|
asm_mod_y
|
||||||
asm_types_h
|
asm_types_h
|
||||||
@@ -3564,6 +3565,11 @@ EOF
|
|||||||
|
|
||||||
enabled_all armv6t2 shared !pic && enable_pic
|
enabled_all armv6t2 shared !pic && enable_pic
|
||||||
|
|
||||||
|
# llvm's integrated assembler supports .object_arch from llvm 3.5
|
||||||
|
[ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
|
||||||
|
.object_arch armv4
|
||||||
|
EOF
|
||||||
|
|
||||||
elif enabled mips; then
|
elif enabled mips; then
|
||||||
|
|
||||||
check_inline_asm loongson '"dmult.g $1, $2, $3"'
|
check_inline_asm loongson '"dmult.g $1, $2, $3"'
|
||||||
|
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = 1.1.15
|
PROJECT_NUMBER = 1.1.16
|
||||||
|
|
||||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
||||||
# in the documentation. The maximum height of the logo should not exceed 55
|
# in the documentation. The maximum height of the logo should not exceed 55
|
||||||
|
2
ffmpeg.c
2
ffmpeg.c
@@ -2020,7 +2020,7 @@ static int transcode_init(void)
|
|||||||
AVCodecContext *codec;
|
AVCodecContext *codec;
|
||||||
OutputStream *ost;
|
OutputStream *ost;
|
||||||
InputStream *ist;
|
InputStream *ist;
|
||||||
char error[1024];
|
char error[1024] = {0};
|
||||||
int want_sdp = 1;
|
int want_sdp = 1;
|
||||||
|
|
||||||
/* init framerate emulation */
|
/* init framerate emulation */
|
||||||
|
@@ -44,7 +44,7 @@ static av_cold int zero12v_decode_init(AVCodecContext *avctx)
|
|||||||
static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||||
int *got_frame, AVPacket *avpkt)
|
int *got_frame, AVPacket *avpkt)
|
||||||
{
|
{
|
||||||
int line = 0, ret;
|
int line, ret;
|
||||||
const int width = avctx->width;
|
const int width = avctx->width;
|
||||||
AVFrame *pic = avctx->coded_frame;
|
AVFrame *pic = avctx->coded_frame;
|
||||||
uint16_t *y, *u, *v;
|
uint16_t *y, *u, *v;
|
||||||
@@ -54,8 +54,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
if (pic->data[0])
|
if (pic->data[0])
|
||||||
avctx->release_buffer(avctx, pic);
|
avctx->release_buffer(avctx, pic);
|
||||||
|
|
||||||
if (width == 1) {
|
if (width <= 1 || avctx->height <= 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n");
|
av_log(avctx, AV_LOG_ERROR, "Dimensions %dx%d not supported.\n", width, avctx->height);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
if (avpkt->size < avctx->height * stride) {
|
if (avpkt->size < avctx->height * stride) {
|
||||||
@@ -68,45 +68,45 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
if ((ret = ff_get_buffer(avctx, pic)) < 0)
|
if ((ret = ff_get_buffer(avctx, pic)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
y = (uint16_t *)pic->data[0];
|
|
||||||
u = (uint16_t *)pic->data[1];
|
|
||||||
v = (uint16_t *)pic->data[2];
|
|
||||||
line_end = avpkt->data + stride;
|
line_end = avpkt->data + stride;
|
||||||
|
for (line = 0; line < avctx->height; line++) {
|
||||||
|
uint16_t y_temp[6] = {0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000};
|
||||||
|
uint16_t u_temp[3] = {0x8000, 0x8000, 0x8000};
|
||||||
|
uint16_t v_temp[3] = {0x8000, 0x8000, 0x8000};
|
||||||
|
int x;
|
||||||
|
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||||
|
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||||
|
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||||
|
|
||||||
while (line++ < avctx->height) {
|
for (x = 0; x < width; x += 6) {
|
||||||
while (1) {
|
uint32_t t;
|
||||||
uint32_t t = AV_RL32(src);
|
|
||||||
|
if (width - x < 6 || line_end - src < 16) {
|
||||||
|
y = y_temp;
|
||||||
|
u = u_temp;
|
||||||
|
v = v_temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (line_end - src < 4)
|
||||||
|
break;
|
||||||
|
|
||||||
|
t = AV_RL32(src);
|
||||||
src += 4;
|
src += 4;
|
||||||
*u++ = t << 6 & 0xFFC0;
|
*u++ = t << 6 & 0xFFC0;
|
||||||
*y++ = t >> 4 & 0xFFC0;
|
*y++ = t >> 4 & 0xFFC0;
|
||||||
*v++ = t >> 14 & 0xFFC0;
|
*v++ = t >> 14 & 0xFFC0;
|
||||||
|
|
||||||
if (src >= line_end - 1) {
|
if (line_end - src < 4)
|
||||||
*y = 0x80;
|
|
||||||
src++;
|
|
||||||
line_end += stride;
|
|
||||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
|
||||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
|
||||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
t = AV_RL32(src);
|
t = AV_RL32(src);
|
||||||
src += 4;
|
src += 4;
|
||||||
*y++ = t << 6 & 0xFFC0;
|
*y++ = t << 6 & 0xFFC0;
|
||||||
*u++ = t >> 4 & 0xFFC0;
|
*u++ = t >> 4 & 0xFFC0;
|
||||||
*y++ = t >> 14 & 0xFFC0;
|
*y++ = t >> 14 & 0xFFC0;
|
||||||
if (src >= line_end - 2) {
|
|
||||||
if (!(width & 1)) {
|
if (line_end - src < 4)
|
||||||
*y = 0x80;
|
|
||||||
src += 2;
|
|
||||||
}
|
|
||||||
line_end += stride;
|
|
||||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
|
||||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
|
||||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
t = AV_RL32(src);
|
t = AV_RL32(src);
|
||||||
src += 4;
|
src += 4;
|
||||||
@@ -114,15 +114,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
*y++ = t >> 4 & 0xFFC0;
|
*y++ = t >> 4 & 0xFFC0;
|
||||||
*u++ = t >> 14 & 0xFFC0;
|
*u++ = t >> 14 & 0xFFC0;
|
||||||
|
|
||||||
if (src >= line_end - 1) {
|
if (line_end - src < 4)
|
||||||
*y = 0x80;
|
|
||||||
src++;
|
|
||||||
line_end += stride;
|
|
||||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
|
||||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
|
||||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
t = AV_RL32(src);
|
t = AV_RL32(src);
|
||||||
src += 4;
|
src += 4;
|
||||||
@@ -130,18 +123,21 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
*v++ = t >> 4 & 0xFFC0;
|
*v++ = t >> 4 & 0xFFC0;
|
||||||
*y++ = t >> 14 & 0xFFC0;
|
*y++ = t >> 14 & 0xFFC0;
|
||||||
|
|
||||||
if (src >= line_end - 2) {
|
if (width - x < 6)
|
||||||
if (width & 1) {
|
|
||||||
*y = 0x80;
|
|
||||||
src += 2;
|
|
||||||
}
|
|
||||||
line_end += stride;
|
|
||||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
|
||||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
|
||||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (x < width) {
|
||||||
|
y = x + (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||||
|
u = x/2 + (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||||
|
v = x/2 + (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||||
|
memcpy(y, y_temp, sizeof(*y) * (width - x));
|
||||||
|
memcpy(u, u_temp, sizeof(*u) * (width - x + 1) / 2);
|
||||||
|
memcpy(v, v_temp, sizeof(*v) * (width - x + 1) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
line_end += stride;
|
||||||
|
src = line_end - stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
*got_frame = 1;
|
*got_frame = 1;
|
||||||
|
@@ -57,9 +57,13 @@ static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
|
|||||||
for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {
|
for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {
|
||||||
for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {
|
for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {
|
||||||
if(x < width && y < height) {
|
if(x < width && y < height) {
|
||||||
/* build average over 2 pixels */
|
if (x + 1 < width) {
|
||||||
luma = (src[(x + 0 + y * p->linesize[0])] +
|
/* build average over 2 pixels */
|
||||||
src[(x + 1 + y * p->linesize[0])]) / 2;
|
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 */
|
/* write blocks as linear data now so they are suitable for elbg */
|
||||||
dest[0] = luma;
|
dest[0] = luma;
|
||||||
}
|
}
|
||||||
|
@@ -166,7 +166,7 @@ static void put_audio_specific_config(AVCodecContext *avctx)
|
|||||||
PutBitContext pb;
|
PutBitContext pb;
|
||||||
AACEncContext *s = avctx->priv_data;
|
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, 5, 2); //object type - AAC-LC
|
||||||
put_bits(&pb, 4, s->samplerate_index); //sample rate index
|
put_bits(&pb, 4, s->samplerate_index); //sample rate index
|
||||||
put_bits(&pb, 4, s->channels);
|
put_bits(&pb, 4, s->channels);
|
||||||
|
@@ -550,7 +550,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
case AV_CODEC_ID_ADPCM_IMA_QT:
|
case AV_CODEC_ID_ADPCM_IMA_QT:
|
||||||
{
|
{
|
||||||
PutBitContext pb;
|
PutBitContext pb;
|
||||||
init_put_bits(&pb, dst, pkt_size * 8);
|
init_put_bits(&pb, dst, pkt_size);
|
||||||
|
|
||||||
for (ch = 0; ch < avctx->channels; ch++) {
|
for (ch = 0; ch < avctx->channels; ch++) {
|
||||||
ADPCMChannelStatus *status = &c->status[ch];
|
ADPCMChannelStatus *status = &c->status[ch];
|
||||||
@@ -580,7 +580,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
case AV_CODEC_ID_ADPCM_SWF:
|
case AV_CODEC_ID_ADPCM_SWF:
|
||||||
{
|
{
|
||||||
PutBitContext pb;
|
PutBitContext pb;
|
||||||
init_put_bits(&pb, dst, pkt_size * 8);
|
init_put_bits(&pb, dst, pkt_size);
|
||||||
|
|
||||||
n = frame->nb_samples - 1;
|
n = frame->nb_samples - 1;
|
||||||
|
|
||||||
|
@@ -98,6 +98,12 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
|
|||||||
int x, y, len, color;
|
int x, y, len, color;
|
||||||
uint8_t *d;
|
uint8_t *d;
|
||||||
|
|
||||||
|
if (start >= buf_size)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (w <= 0 || h <= 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
bit_len = (buf_size - start) * 8;
|
bit_len = (buf_size - start) * 8;
|
||||||
init_get_bits(&gb, buf + start, bit_len);
|
init_get_bits(&gb, buf + start, bit_len);
|
||||||
|
|
||||||
@@ -339,10 +345,12 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
|||||||
sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
|
sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
|
||||||
sub_header->num_rects = 1;
|
sub_header->num_rects = 1;
|
||||||
sub_header->rects[0]->pict.data[0] = bitmap;
|
sub_header->rects[0]->pict.data[0] = bitmap;
|
||||||
decode_rle(bitmap, w * 2, w, (h + 1) / 2,
|
if (decode_rle(bitmap, w * 2, w, (h + 1) / 2,
|
||||||
buf, offset1, buf_size, is_8bit);
|
buf, offset1, buf_size, is_8bit) < 0)
|
||||||
decode_rle(bitmap + w, w * 2, w, h / 2,
|
goto fail;
|
||||||
buf, offset2, buf_size, is_8bit);
|
if (decode_rle(bitmap + w, w * 2, w, h / 2,
|
||||||
|
buf, offset2, buf_size, is_8bit) < 0)
|
||||||
|
goto fail;
|
||||||
sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
|
sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
|
||||||
if (is_8bit) {
|
if (is_8bit) {
|
||||||
if (yuv_palette == 0)
|
if (yuv_palette == 0)
|
||||||
|
@@ -140,6 +140,11 @@ static inline int decode_block_intra(MadContext *s, DCTELEM * block)
|
|||||||
break;
|
break;
|
||||||
} else if (level != 0) {
|
} else if (level != 0) {
|
||||||
i += run;
|
i += run;
|
||||||
|
if (i > 63) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
|
"ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
j = scantable[i];
|
j = scantable[i];
|
||||||
level = (level*quant_matrix[j]) >> 4;
|
level = (level*quant_matrix[j]) >> 4;
|
||||||
level = (level-1)|1;
|
level = (level-1)|1;
|
||||||
@@ -154,6 +159,11 @@ static inline int decode_block_intra(MadContext *s, DCTELEM * block)
|
|||||||
run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
|
run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
|
||||||
|
|
||||||
i += run;
|
i += run;
|
||||||
|
if (i > 63) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
|
"ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
j = scantable[i];
|
j = scantable[i];
|
||||||
if (level < 0) {
|
if (level < 0) {
|
||||||
level = -level;
|
level = -level;
|
||||||
@@ -165,10 +175,6 @@ static inline int decode_block_intra(MadContext *s, DCTELEM * block)
|
|||||||
level = (level-1)|1;
|
level = (level-1)|1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i > 63) {
|
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
block[j] = level;
|
block[j] = level;
|
||||||
}
|
}
|
||||||
|
@@ -247,7 +247,7 @@ static void put_line(uint8_t *dst, int size, int width, const int *runs)
|
|||||||
PutBitContext pb;
|
PutBitContext pb;
|
||||||
int run, mode = ~0, pix_left = width, run_idx = 0;
|
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){
|
while(pix_left > 0){
|
||||||
run = runs[run_idx++];
|
run = runs[run_idx++];
|
||||||
mode = ~mode;
|
mode = ~mode;
|
||||||
|
@@ -655,7 +655,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
|||||||
handle_error:
|
handle_error:
|
||||||
*poutbuf = NULL;
|
*poutbuf = NULL;
|
||||||
*poutbuf_size = 0;
|
*poutbuf_size = 0;
|
||||||
return read_end - buf;
|
return buf_size ? read_end - buf : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int flac_parse_init(AVCodecParserContext *c)
|
static int flac_parse_init(AVCodecParserContext *c)
|
||||||
|
@@ -288,7 +288,7 @@ static int write_header(FlashSV2Context * s, uint8_t * buf, int buf_size)
|
|||||||
if (buf_size < 5)
|
if (buf_size < 5)
|
||||||
return -1;
|
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, 4, (s->block_width >> 4) - 1);
|
||||||
put_bits(&pb, 12, s->image_width);
|
put_bits(&pb, 12, s->image_width);
|
||||||
|
@@ -131,7 +131,7 @@ static int encode_bitstream(FlashSVContext *s, AVFrame *p, uint8_t *buf,
|
|||||||
int buf_pos, res;
|
int buf_pos, res;
|
||||||
int pred_blocks = 0;
|
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, 4, block_width / 16 - 1);
|
||||||
put_bits(&pb, 12, s->image_width);
|
put_bits(&pb, 12, s->image_width);
|
||||||
|
@@ -1712,7 +1712,7 @@ decode_cabac_residual_internal(H264Context *h, DCTELEM *block,
|
|||||||
\
|
\
|
||||||
if( coeff_abs >= 15 ) { \
|
if( coeff_abs >= 15 ) { \
|
||||||
int j = 0; \
|
int j = 0; \
|
||||||
while( get_cabac_bypass( CC ) ) { \
|
while (get_cabac_bypass(CC) && j < 30) { \
|
||||||
j++; \
|
j++; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
|
@@ -387,7 +387,9 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
|
|||||||
}
|
}
|
||||||
sps->bit_depth_luma = get_ue_golomb(&s->gb) + 8;
|
sps->bit_depth_luma = get_ue_golomb(&s->gb) + 8;
|
||||||
sps->bit_depth_chroma = get_ue_golomb(&s->gb) + 8;
|
sps->bit_depth_chroma = get_ue_golomb(&s->gb) + 8;
|
||||||
if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U || sps->bit_depth_luma != sps->bit_depth_chroma) {
|
if (sps->bit_depth_luma < 8 || sps->bit_depth_luma > 14 ||
|
||||||
|
sps->bit_depth_chroma < 8 || sps->bit_depth_chroma > 14 ||
|
||||||
|
sps->bit_depth_luma != sps->bit_depth_chroma) {
|
||||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
|
av_log(h->s.avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
|
||||||
sps->bit_depth_luma, sps->bit_depth_chroma);
|
sps->bit_depth_luma, sps->bit_depth_chroma);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@@ -89,7 +89,7 @@ static void ff_acelp_interpolatef_mips(float *out, const float *in,
|
|||||||
"addu %[p_filter_coeffs_m], %[p_filter_coeffs_m], %[prec] \n\t"
|
"addu %[p_filter_coeffs_m], %[p_filter_coeffs_m], %[prec] \n\t"
|
||||||
"madd.s %[v],%[v],%[in_val_m], %[fc_val_m] \n\t"
|
"madd.s %[v],%[v],%[in_val_m], %[fc_val_m] \n\t"
|
||||||
|
|
||||||
: [v] "=&f" (v),[p_in_p] "+r" (p_in_p), [p_in_m] "+r" (p_in_m),
|
: [v] "+&f" (v),[p_in_p] "+r" (p_in_p), [p_in_m] "+r" (p_in_m),
|
||||||
[p_filter_coeffs_p] "+r" (p_filter_coeffs_p),
|
[p_filter_coeffs_p] "+r" (p_filter_coeffs_p),
|
||||||
[in_val_p] "=&f" (in_val_p), [in_val_m] "=&f" (in_val_m),
|
[in_val_p] "=&f" (in_val_p), [in_val_m] "=&f" (in_val_m),
|
||||||
[fc_val_p] "=&f" (fc_val_p), [fc_val_m] "=&f" (fc_val_m),
|
[fc_val_p] "=&f" (fc_val_p), [fc_val_m] "=&f" (fc_val_m),
|
||||||
|
@@ -439,9 +439,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
}
|
}
|
||||||
if (s->ls) {
|
if (s->ls) {
|
||||||
s->upscale_h = s->upscale_v = 0;
|
s->upscale_h = s->upscale_v = 0;
|
||||||
if (s->nb_components > 1)
|
if (s->nb_components == 3) {
|
||||||
s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
|
s->avctx->pix_fmt = AV_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 = AV_PIX_FMT_GRAY8;
|
s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
|
||||||
else
|
else
|
||||||
s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
|
s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
|
||||||
@@ -1076,12 +1079,17 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
|
|||||||
|
|
||||||
if (s->interlaced && s->bottom_field)
|
if (s->interlaced && s->bottom_field)
|
||||||
block_offset += linesize[c] >> 1;
|
block_offset += linesize[c] >> 1;
|
||||||
ptr = data[c] + block_offset;
|
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 (!s->progressive) {
|
||||||
if (copy_mb)
|
if (copy_mb) {
|
||||||
mjpeg_copy_block(ptr, reference_data[c] + block_offset,
|
if (ptr)
|
||||||
linesize[c], s->avctx->lowres);
|
mjpeg_copy_block(ptr, reference_data[c] + block_offset,
|
||||||
else {
|
linesize[c], s->avctx->lowres);
|
||||||
|
} else {
|
||||||
s->dsp.clear_block(s->block);
|
s->dsp.clear_block(s->block);
|
||||||
if (decode_block(s, s->block, i,
|
if (decode_block(s, s->block, i,
|
||||||
s->dc_index[i], s->ac_index[i],
|
s->dc_index[i], s->ac_index[i],
|
||||||
@@ -1090,7 +1098,9 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
|
|||||||
"error y=%d x=%d\n", mb_y, mb_x);
|
"error y=%d x=%d\n", mb_y, mb_x);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
s->dsp.idct_put(ptr, linesize[c], s->block);
|
if (ptr) {
|
||||||
|
s->dsp.idct_put(ptr, linesize[c], s->block);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int block_idx = s->block_stride[c] * (v * mb_y + y) +
|
int block_idx = s->block_stride[c] * (v * mb_y + y) +
|
||||||
@@ -1631,6 +1641,10 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
|
|||||||
put_bits(&pb, 8, x);
|
put_bits(&pb, 8, x);
|
||||||
if (x == 0xFF) {
|
if (x == 0xFF) {
|
||||||
x = src[b++];
|
x = src[b++];
|
||||||
|
if (x & 0x80) {
|
||||||
|
av_log(s->avctx, AV_LOG_WARNING, "Invalid escape sequence\n");
|
||||||
|
x &= 0x7f;
|
||||||
|
}
|
||||||
put_bits(&pb, 7, x);
|
put_bits(&pb, 7, x);
|
||||||
bit_count--;
|
bit_count--;
|
||||||
}
|
}
|
||||||
|
@@ -910,7 +910,7 @@ int ff_h261_get_picture_format(int width, int height);
|
|||||||
|
|
||||||
|
|
||||||
/* rv10.c */
|
/* rv10.c */
|
||||||
void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number);
|
int ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number);
|
||||||
int ff_rv_decode_dc(MpegEncContext *s, int n);
|
int ff_rv_decode_dc(MpegEncContext *s, int n);
|
||||||
void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number);
|
void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number);
|
||||||
|
|
||||||
|
@@ -411,18 +411,18 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
|
|||||||
switch(avctx->codec_id) {
|
switch(avctx->codec_id) {
|
||||||
case AV_CODEC_ID_MPEG1VIDEO:
|
case AV_CODEC_ID_MPEG1VIDEO:
|
||||||
case AV_CODEC_ID_MPEG2VIDEO:
|
case AV_CODEC_ID_MPEG2VIDEO:
|
||||||
avctx->rc_buffer_size = FFMAX(avctx->rc_max_rate, 15000000) * 112L / 15000000 * 16384;
|
avctx->rc_buffer_size = FFMAX(avctx->rc_max_rate, 15000000) * 112LL / 15000000 * 16384;
|
||||||
break;
|
break;
|
||||||
case AV_CODEC_ID_MPEG4:
|
case AV_CODEC_ID_MPEG4:
|
||||||
case AV_CODEC_ID_MSMPEG4V1:
|
case AV_CODEC_ID_MSMPEG4V1:
|
||||||
case AV_CODEC_ID_MSMPEG4V2:
|
case AV_CODEC_ID_MSMPEG4V2:
|
||||||
case AV_CODEC_ID_MSMPEG4V3:
|
case AV_CODEC_ID_MSMPEG4V3:
|
||||||
if (avctx->rc_max_rate >= 15000000) {
|
if (avctx->rc_max_rate >= 15000000) {
|
||||||
avctx->rc_buffer_size = 320 + (avctx->rc_max_rate - 15000000L) * (760-320) / (38400000 - 15000000);
|
avctx->rc_buffer_size = 320 + (avctx->rc_max_rate - 15000000LL) * (760-320) / (38400000 - 15000000);
|
||||||
} else if(avctx->rc_max_rate >= 2000000) {
|
} else if(avctx->rc_max_rate >= 2000000) {
|
||||||
avctx->rc_buffer_size = 80 + (avctx->rc_max_rate - 2000000L) * (320- 80) / (15000000 - 2000000);
|
avctx->rc_buffer_size = 80 + (avctx->rc_max_rate - 2000000LL) * (320- 80) / (15000000 - 2000000);
|
||||||
} else if(avctx->rc_max_rate >= 384000) {
|
} else if(avctx->rc_max_rate >= 384000) {
|
||||||
avctx->rc_buffer_size = 40 + (avctx->rc_max_rate - 384000L) * ( 80- 40) / ( 2000000 - 384000);
|
avctx->rc_buffer_size = 40 + (avctx->rc_max_rate - 384000LL) * ( 80- 40) / ( 2000000 - 384000);
|
||||||
} else
|
} else
|
||||||
avctx->rc_buffer_size = 40;
|
avctx->rc_buffer_size = 40;
|
||||||
avctx->rc_buffer_size *= 16384;
|
avctx->rc_buffer_size *= 16384;
|
||||||
@@ -3447,8 +3447,11 @@ static int encode_picture(MpegEncContext *s, int picture_number)
|
|||||||
ff_msmpeg4_encode_picture_header(s, picture_number);
|
ff_msmpeg4_encode_picture_header(s, picture_number);
|
||||||
else if (CONFIG_MPEG4_ENCODER && s->h263_pred)
|
else if (CONFIG_MPEG4_ENCODER && s->h263_pred)
|
||||||
ff_mpeg4_encode_picture_header(s, picture_number);
|
ff_mpeg4_encode_picture_header(s, picture_number);
|
||||||
else if (CONFIG_RV10_ENCODER && s->codec_id == AV_CODEC_ID_RV10)
|
else if (CONFIG_RV10_ENCODER && s->codec_id == AV_CODEC_ID_RV10) {
|
||||||
ff_rv10_encode_picture_header(s, picture_number);
|
ret = ff_rv10_encode_picture_header(s, picture_number);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
else if (CONFIG_RV20_ENCODER && s->codec_id == AV_CODEC_ID_RV20)
|
else if (CONFIG_RV20_ENCODER && s->codec_id == AV_CODEC_ID_RV20)
|
||||||
ff_rv20_encode_picture_header(s, picture_number);
|
ff_rv20_encode_picture_header(s, picture_number);
|
||||||
else if (CONFIG_FLV_ENCODER && s->codec_id == AV_CODEC_ID_FLV1)
|
else if (CONFIG_FLV_ENCODER && s->codec_id == AV_CODEC_ID_FLV1)
|
||||||
|
@@ -315,7 +315,7 @@ static void encode_block(NellyMoserEncodeContext *s, unsigned char *output, int
|
|||||||
|
|
||||||
apply_mdct(s);
|
apply_mdct(s);
|
||||||
|
|
||||||
init_put_bits(&pb, output, output_size * 8);
|
init_put_bits(&pb, output, output_size);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for (band = 0; band < NELLY_BANDS; band++) {
|
for (band = 0; band < NELLY_BANDS; band++) {
|
||||||
|
@@ -98,7 +98,6 @@ static const AVOption options[]={
|
|||||||
{"hex", "hex motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_HEX }, INT_MIN, INT_MAX, V|E, "me_method" },
|
{"hex", "hex motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_HEX }, INT_MIN, INT_MAX, V|E, "me_method" },
|
||||||
{"umh", "umh motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_UMH }, INT_MIN, INT_MAX, V|E, "me_method" },
|
{"umh", "umh motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_UMH }, INT_MIN, INT_MAX, V|E, "me_method" },
|
||||||
{"iter", "iter motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_ITER }, INT_MIN, INT_MAX, V|E, "me_method" },
|
{"iter", "iter motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = ME_ITER }, INT_MIN, INT_MAX, V|E, "me_method" },
|
||||||
{"extradata_size", NULL, OFFSET(extradata_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
|
||||||
{"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, INT_MIN, INT_MAX},
|
{"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, INT_MIN, INT_MAX},
|
||||||
{"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
|
{"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
|
||||||
{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
|
{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
|
||||||
|
@@ -303,7 +303,7 @@ static int encode_slice_plane(AVCodecContext *avctx, int mb_count,
|
|||||||
}
|
}
|
||||||
|
|
||||||
blocks_per_slice = mb_count << (2 - chroma);
|
blocks_per_slice = mb_count << (2 - chroma);
|
||||||
init_put_bits(&pb, buf, buf_size << 3);
|
init_put_bits(&pb, buf, buf_size);
|
||||||
|
|
||||||
encode_dc_coeffs(&pb, blocks, blocks_per_slice, qmat);
|
encode_dc_coeffs(&pb, blocks, blocks_per_slice, qmat);
|
||||||
encode_ac_coeffs(avctx, &pb, blocks, blocks_per_slice, qmat);
|
encode_ac_coeffs(avctx, &pb, blocks, blocks_per_slice, qmat);
|
||||||
|
@@ -836,7 +836,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
bytestream_put_byte(&buf, slice_hdr_size << 3);
|
bytestream_put_byte(&buf, slice_hdr_size << 3);
|
||||||
slice_hdr = buf;
|
slice_hdr = buf;
|
||||||
buf += slice_hdr_size - 1;
|
buf += slice_hdr_size - 1;
|
||||||
init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8);
|
init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)));
|
||||||
ret = encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice);
|
ret = encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@@ -942,6 +942,8 @@ static int roq_encode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
av_lfg_init(&enc->randctx, 1);
|
av_lfg_init(&enc->randctx, 1);
|
||||||
|
|
||||||
|
enc->avctx = avctx;
|
||||||
|
|
||||||
enc->framesSinceKeyframe = 0;
|
enc->framesSinceKeyframe = 0;
|
||||||
if ((avctx->width & 0xf) || (avctx->height & 0xf)) {
|
if ((avctx->width & 0xf) || (avctx->height & 0xf)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n");
|
av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n");
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#include "mpegvideo.h"
|
#include "mpegvideo.h"
|
||||||
#include "put_bits.h"
|
#include "put_bits.h"
|
||||||
|
|
||||||
void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number)
|
int ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number)
|
||||||
{
|
{
|
||||||
int full_frame= 0;
|
int full_frame= 0;
|
||||||
|
|
||||||
@@ -48,12 +48,17 @@ void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number)
|
|||||||
/* if multiple packets per frame are sent, the position at which
|
/* if multiple packets per frame are sent, the position at which
|
||||||
to display the macroblocks is coded here */
|
to display the macroblocks is coded here */
|
||||||
if(!full_frame){
|
if(!full_frame){
|
||||||
|
if (s->mb_width * s->mb_height >= (1U << 12)) {
|
||||||
|
av_log_missing_feature(s->avctx, "Encoding frames with 4096 macroblocks or more", 0);
|
||||||
|
return AVERROR(ENOSYS);
|
||||||
|
}
|
||||||
put_bits(&s->pb, 6, 0); /* mb_x */
|
put_bits(&s->pb, 6, 0); /* mb_x */
|
||||||
put_bits(&s->pb, 6, 0); /* mb_y */
|
put_bits(&s->pb, 6, 0); /* mb_y */
|
||||||
put_bits(&s->pb, 12, s->mb_width * s->mb_height);
|
put_bits(&s->pb, 12, s->mb_width * s->mb_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
put_bits(&s->pb, 3, 0); /* ignored */
|
put_bits(&s->pb, 3, 0); /* ignored */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FF_MPV_GENERIC_CLASS(rv10)
|
FF_MPV_GENERIC_CLASS(rv10)
|
||||||
|
@@ -156,7 +156,7 @@ static int decode_q_branch(SnowContext *s, int level, int x, int y){
|
|||||||
int l = left->color[0];
|
int l = left->color[0];
|
||||||
int cb= left->color[1];
|
int cb= left->color[1];
|
||||||
int cr= left->color[2];
|
int cr= left->color[2];
|
||||||
int ref = 0;
|
unsigned ref = 0;
|
||||||
int ref_context= av_log2(2*left->ref) + av_log2(2*top->ref);
|
int ref_context= av_log2(2*left->ref) + av_log2(2*top->ref);
|
||||||
int mx_context= av_log2(2*FFABS(left->mx - top->mx)) + 0*av_log2(2*FFABS(tr->mx - top->mx));
|
int mx_context= av_log2(2*FFABS(left->mx - top->mx)) + 0*av_log2(2*FFABS(tr->mx - top->mx));
|
||||||
int my_context= av_log2(2*FFABS(left->my - top->my)) + 0*av_log2(2*FFABS(tr->my - top->my));
|
int my_context= av_log2(2*FFABS(left->my - top->my)) + 0*av_log2(2*FFABS(tr->my - top->my));
|
||||||
|
@@ -605,6 +605,14 @@ static int init_image(TiffContext *s)
|
|||||||
int i, ret;
|
int i, ret;
|
||||||
uint32_t *pal;
|
uint32_t *pal;
|
||||||
|
|
||||||
|
// make sure there is no aliasing in the following switch
|
||||||
|
if (s->bpp >= 100 || s->bppcount >= 10) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
|
"Unsupported image parameters: bpp=%d, bppcount=%d\n",
|
||||||
|
s->bpp, s->bppcount);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
switch (s->bpp * 10 + s->bppcount) {
|
switch (s->bpp * 10 + s->bppcount) {
|
||||||
case 11:
|
case 11:
|
||||||
if (!s->palette_is_set) {
|
if (!s->palette_is_set) {
|
||||||
@@ -747,13 +755,6 @@ static int tiff_decode_tag(TiffContext *s)
|
|||||||
s->bpp = -1;
|
s->bpp = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case TIFF_SAMPLES_PER_PIXEL:
|
case TIFF_SAMPLES_PER_PIXEL:
|
||||||
if (count != 1) {
|
if (count != 1) {
|
||||||
@@ -1029,6 +1030,13 @@ static int tiff_decode_tag(TiffContext *s)
|
|||||||
av_log(s->avctx, AV_LOG_DEBUG, "Unknown or unsupported tag %d/0X%0X\n",
|
av_log(s->avctx, AV_LOG_DEBUG, "Unknown or unsupported tag %d/0X%0X\n",
|
||||||
tag, tag);
|
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;
|
||||||
|
}
|
||||||
bytestream2_seek(&s->gb, start, SEEK_SET);
|
bytestream2_seek(&s->gb, start, SEEK_SET);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -248,7 +248,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
|||||||
case AV_PIX_FMT_YUV411P:
|
case AV_PIX_FMT_YUV411P:
|
||||||
case AV_PIX_FMT_UYYVYY411:
|
case AV_PIX_FMT_UYYVYY411:
|
||||||
w_align = 32;
|
w_align = 32;
|
||||||
h_align = 8;
|
h_align = 16 * 2;
|
||||||
break;
|
break;
|
||||||
case AV_PIX_FMT_YUV410P:
|
case AV_PIX_FMT_YUV410P:
|
||||||
if (s->codec_id == AV_CODEC_ID_SVQ1) {
|
if (s->codec_id == AV_CODEC_ID_SVQ1) {
|
||||||
|
@@ -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_6, 0x14 )
|
||||||
FIRMUL (ff_mlp_firorder_5, 0x10 )
|
FIRMUL (ff_mlp_firorder_5, 0x10 )
|
||||||
FIRMUL (ff_mlp_firorder_4, 0x0c )
|
FIRMUL (ff_mlp_firorder_4, 0x0c )
|
||||||
FIRMULREG(ff_mlp_firorder_3, 0x08,10)
|
FIRMUL (ff_mlp_firorder_3, 0x08 )
|
||||||
FIRMULREG(ff_mlp_firorder_2, 0x04, 9)
|
FIRMUL (ff_mlp_firorder_2, 0x04 )
|
||||||
FIRMULREG(ff_mlp_firorder_1, 0x00, 8)
|
FIRMULREG(ff_mlp_firorder_1, 0x00, 8)
|
||||||
LABEL_MANGLE(ff_mlp_firorder_0)":\n\t"
|
LABEL_MANGLE(ff_mlp_firorder_0)":\n\t"
|
||||||
"jmp *%6 \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),
|
: /* 4*/"r"((x86_reg)mask), /* 5*/"r"(firjump),
|
||||||
/* 6*/"r"(iirjump) , /* 7*/"c"(filter_shift)
|
/* 6*/"r"(iirjump) , /* 7*/"c"(filter_shift)
|
||||||
, /* 8*/"r"((int64_t)coeff[0])
|
, /* 8*/"r"((int64_t)coeff[0])
|
||||||
, /* 9*/"r"((int64_t)coeff[1])
|
|
||||||
, /*10*/"r"((int64_t)coeff[2])
|
|
||||||
: "rax", "rdx", "rsi"
|
: "rax", "rdx", "rsi"
|
||||||
#else /* ARCH_X86_32 */
|
#else /* ARCH_X86_32 */
|
||||||
/* 3*/"+m"(blocksize)
|
/* 3*/"+m"(blocksize)
|
||||||
|
@@ -418,11 +418,16 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* parse header */
|
/* parse header */
|
||||||
|
if (len < 1)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
c->flags = buf[0];
|
c->flags = buf[0];
|
||||||
buf++; len--;
|
buf++; len--;
|
||||||
if (c->flags & ZMBV_KEYFRAME) {
|
if (c->flags & ZMBV_KEYFRAME) {
|
||||||
void *decode_intra = NULL;
|
void *decode_intra = NULL;
|
||||||
c->decode_intra= NULL;
|
c->decode_intra= NULL;
|
||||||
|
|
||||||
|
if (len < 6)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
hi_ver = buf[0];
|
hi_ver = buf[0];
|
||||||
lo_ver = buf[1];
|
lo_ver = buf[1];
|
||||||
c->comp = buf[2];
|
c->comp = buf[2];
|
||||||
|
@@ -41,6 +41,11 @@ static int adx_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
AVCodecContext *avctx = s->streams[0]->codec;
|
AVCodecContext *avctx = s->streams[0]->codec;
|
||||||
int ret, size;
|
int ret, size;
|
||||||
|
|
||||||
|
if (avctx->channels <= 0) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "invalid number of channels %d\n", avctx->channels);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
size = BLOCK_SIZE * avctx->channels;
|
size = BLOCK_SIZE * avctx->channels;
|
||||||
|
|
||||||
pkt->pos = avio_tell(s->pb);
|
pkt->pos = avio_tell(s->pb);
|
||||||
|
@@ -119,8 +119,12 @@ static int write_header(AVFormatContext *s)
|
|||||||
{
|
{
|
||||||
AVCodecContext *enc = s->streams[0]->codec;
|
AVCodecContext *enc = s->streams[0]->codec;
|
||||||
|
|
||||||
enc->codec_id = AV_CODEC_ID_G729;
|
if ((enc->codec_id != AV_CODEC_ID_G729) || enc->channels != 1) {
|
||||||
enc->channels = 1;
|
av_log(s, AV_LOG_ERROR,
|
||||||
|
"only codec g729 with 1 channel is supported by this format\n");
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
enc->bits_per_coded_sample = 16;
|
enc->bits_per_coded_sample = 16;
|
||||||
enc->block_align = (enc->bits_per_coded_sample * enc->channels) >> 3;
|
enc->block_align = (enc->bits_per_coded_sample * enc->channels) >> 3;
|
||||||
|
|
||||||
@@ -133,6 +137,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (pkt->size != 10)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
avio_wl16(pb, SYNC_WORD);
|
avio_wl16(pb, SYNC_WORD);
|
||||||
avio_wl16(pb, 8 * 10);
|
avio_wl16(pb, 8 * 10);
|
||||||
|
|
||||||
|
@@ -127,6 +127,8 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
height = AV_RB16(&cdxl->header[16]);
|
height = AV_RB16(&cdxl->header[16]);
|
||||||
palette_size = AV_RB16(&cdxl->header[20]);
|
palette_size = AV_RB16(&cdxl->header[20]);
|
||||||
audio_size = AV_RB16(&cdxl->header[22]);
|
audio_size = AV_RB16(&cdxl->header[22]);
|
||||||
|
if (FFALIGN(width, 16) * (uint64_t)height * cdxl->header[19] > INT_MAX)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
image_size = FFALIGN(width, 16) * height * cdxl->header[19] / 8;
|
image_size = FFALIGN(width, 16) * height * cdxl->header[19] / 8;
|
||||||
video_size = palette_size + image_size;
|
video_size = palette_size + image_size;
|
||||||
|
|
||||||
|
@@ -77,6 +77,7 @@ static int ffm_read_data(AVFormatContext *s,
|
|||||||
FFMContext *ffm = s->priv_data;
|
FFMContext *ffm = s->priv_data;
|
||||||
AVIOContext *pb = s->pb;
|
AVIOContext *pb = s->pb;
|
||||||
int len, fill_size, size1, frame_offset, id;
|
int len, fill_size, size1, frame_offset, id;
|
||||||
|
int64_t last_pos = -1;
|
||||||
|
|
||||||
size1 = size;
|
size1 = size;
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
@@ -96,9 +97,11 @@ static int ffm_read_data(AVFormatContext *s,
|
|||||||
avio_seek(pb, tell, SEEK_SET);
|
avio_seek(pb, tell, SEEK_SET);
|
||||||
}
|
}
|
||||||
id = avio_rb16(pb); /* PACKET_ID */
|
id = avio_rb16(pb); /* PACKET_ID */
|
||||||
if (id != PACKET_ID)
|
if (id != PACKET_ID) {
|
||||||
if (ffm_resync(s, id) < 0)
|
if (ffm_resync(s, id) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
last_pos = avio_tell(pb);
|
||||||
|
}
|
||||||
fill_size = avio_rb16(pb);
|
fill_size = avio_rb16(pb);
|
||||||
ffm->dts = avio_rb64(pb);
|
ffm->dts = avio_rb64(pb);
|
||||||
frame_offset = avio_rb16(pb);
|
frame_offset = avio_rb16(pb);
|
||||||
@@ -112,7 +115,9 @@ static int ffm_read_data(AVFormatContext *s,
|
|||||||
if (!frame_offset) {
|
if (!frame_offset) {
|
||||||
/* This packet has no frame headers in it */
|
/* This packet has no frame headers in it */
|
||||||
if (avio_tell(pb) >= ffm->packet_size * 3LL) {
|
if (avio_tell(pb) >= ffm->packet_size * 3LL) {
|
||||||
avio_seek(pb, -ffm->packet_size * 2LL, SEEK_CUR);
|
int64_t seekback = FFMIN(ffm->packet_size * 2LL, avio_tell(pb) - last_pos);
|
||||||
|
seekback = FFMAX(seekback, 0);
|
||||||
|
avio_seek(pb, -seekback, SEEK_CUR);
|
||||||
goto retry_read;
|
goto retry_read;
|
||||||
}
|
}
|
||||||
/* This is bad, we cannot find a valid frame header */
|
/* This is bad, we cannot find a valid frame header */
|
||||||
@@ -292,6 +297,11 @@ static int ffm2_read_header(AVFormatContext *s)
|
|||||||
case MKBETAG('S', 'T', 'V', 'I'):
|
case MKBETAG('S', 'T', 'V', 'I'):
|
||||||
codec->time_base.num = avio_rb32(pb);
|
codec->time_base.num = avio_rb32(pb);
|
||||||
codec->time_base.den = avio_rb32(pb);
|
codec->time_base.den = avio_rb32(pb);
|
||||||
|
if (codec->time_base.num <= 0 || codec->time_base.den <= 0) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Invalid time base %d/%d\n",
|
||||||
|
codec->time_base.num, codec->time_base.den);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
codec->width = avio_rb16(pb);
|
codec->width = avio_rb16(pb);
|
||||||
codec->height = avio_rb16(pb);
|
codec->height = avio_rb16(pb);
|
||||||
codec->gop_size = avio_rb16(pb);
|
codec->gop_size = avio_rb16(pb);
|
||||||
@@ -347,7 +357,7 @@ static int ffm2_read_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get until end of block reached */
|
/* get until end of block reached */
|
||||||
while ((avio_tell(pb) % ffm->packet_size) != 0)
|
while ((avio_tell(pb) % ffm->packet_size) != 0 && !pb->eof_reached)
|
||||||
avio_r8(pb);
|
avio_r8(pb);
|
||||||
|
|
||||||
/* init packet demux */
|
/* init packet demux */
|
||||||
@@ -416,6 +426,11 @@ static int ffm_read_header(AVFormatContext *s)
|
|||||||
case AVMEDIA_TYPE_VIDEO:
|
case AVMEDIA_TYPE_VIDEO:
|
||||||
codec->time_base.num = avio_rb32(pb);
|
codec->time_base.num = avio_rb32(pb);
|
||||||
codec->time_base.den = avio_rb32(pb);
|
codec->time_base.den = avio_rb32(pb);
|
||||||
|
if (codec->time_base.num <= 0 || codec->time_base.den <= 0) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Invalid time base %d/%d\n",
|
||||||
|
codec->time_base.num, codec->time_base.den);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
codec->width = avio_rb16(pb);
|
codec->width = avio_rb16(pb);
|
||||||
codec->height = avio_rb16(pb);
|
codec->height = avio_rb16(pb);
|
||||||
codec->gop_size = avio_rb16(pb);
|
codec->gop_size = avio_rb16(pb);
|
||||||
@@ -477,7 +492,7 @@ static int ffm_read_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get until end of block reached */
|
/* get until end of block reached */
|
||||||
while ((avio_tell(pb) % ffm->packet_size) != 0)
|
while ((avio_tell(pb) % ffm->packet_size) != 0 && !pb->eof_reached)
|
||||||
avio_r8(pb);
|
avio_r8(pb);
|
||||||
|
|
||||||
/* init packet demux */
|
/* init packet demux */
|
||||||
|
@@ -475,7 +475,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
avio_w8(pb, FLV_TAG_TYPE_VIDEO);
|
avio_w8(pb, FLV_TAG_TYPE_VIDEO);
|
||||||
|
|
||||||
flags = enc->codec_tag;
|
flags = enc->codec_tag;
|
||||||
if (flags == 0) {
|
if (flags <= 0 || flags > 15) {
|
||||||
av_log(s, AV_LOG_ERROR,
|
av_log(s, AV_LOG_ERROR,
|
||||||
"Video codec '%s' is not compatible with FLV\n",
|
"Video codec '%s' is not compatible with FLV\n",
|
||||||
avcodec_get_name(enc->codec_id));
|
avcodec_get_name(enc->codec_id));
|
||||||
|
@@ -548,7 +548,7 @@ static int gxf_packet(AVFormatContext *s, AVPacket *pkt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int gxf_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) {
|
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 pos;
|
||||||
uint64_t maxlen = 100 * 1024 * 1024;
|
uint64_t maxlen = 100 * 1024 * 1024;
|
||||||
AVStream *st = s->streams[0];
|
AVStream *st = s->streams[0];
|
||||||
|
@@ -2393,7 +2393,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
|
|||||||
int64_t timestamp, int flags)
|
int64_t timestamp, int flags)
|
||||||
{
|
{
|
||||||
MatroskaDemuxContext *matroska = s->priv_data;
|
MatroskaDemuxContext *matroska = s->priv_data;
|
||||||
MatroskaTrack *tracks = matroska->tracks.elem;
|
MatroskaTrack *tracks = NULL;
|
||||||
AVStream *st = s->streams[stream_index];
|
AVStream *st = s->streams[stream_index];
|
||||||
int i, index, index_sub, index_min;
|
int i, index, index_sub, index_min;
|
||||||
|
|
||||||
@@ -2422,6 +2422,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
|
|||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
index_min = index;
|
index_min = index;
|
||||||
|
tracks = matroska->tracks.elem;
|
||||||
for (i=0; i < matroska->tracks.nb_elem; i++) {
|
for (i=0; i < matroska->tracks.nb_elem; i++) {
|
||||||
tracks[i].audio.pkt_cnt = 0;
|
tracks[i].audio.pkt_cnt = 0;
|
||||||
tracks[i].audio.sub_packet_cnt = 0;
|
tracks[i].audio.sub_packet_cnt = 0;
|
||||||
|
@@ -281,7 +281,11 @@ static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
|
|||||||
static int mov_metadata_raw(MOVContext *c, AVIOContext *pb,
|
static int mov_metadata_raw(MOVContext *c, AVIOContext *pb,
|
||||||
unsigned len, const char *key)
|
unsigned len, const char *key)
|
||||||
{
|
{
|
||||||
char *value = av_malloc(len + 1);
|
char *value;
|
||||||
|
// Check for overflow.
|
||||||
|
if (len >= INT_MAX)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
value = av_malloc(len + 1);
|
||||||
if (!value)
|
if (!value)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
avio_read(pb, value, len);
|
avio_read(pb, value, len);
|
||||||
@@ -385,7 +389,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
|
|
||||||
if (!key)
|
if (!key)
|
||||||
return 0;
|
return 0;
|
||||||
if (atom.size < 0)
|
if (atom.size < 0 || str_size >= INT_MAX/2)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
str_size = FFMIN3(sizeof(str)-1, str_size, atom.size);
|
str_size = FFMIN3(sizeof(str)-1, str_size, atom.size);
|
||||||
@@ -2833,7 +2837,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
total_size += 8;
|
total_size += 8;
|
||||||
if (a.size == 1) { /* 64 bit extended size */
|
if (a.size == 1 && total_size + 8 <= atom.size) { /* 64 bit extended size */
|
||||||
a.size = avio_rb64(pb) - 8;
|
a.size = avio_rb64(pb) - 8;
|
||||||
total_size += 8;
|
total_size += 8;
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,7 @@ typedef struct {
|
|||||||
|
|
||||||
static inline int64_t bs_get_v(const uint8_t **bs)
|
static inline int64_t bs_get_v(const uint8_t **bs)
|
||||||
{
|
{
|
||||||
int64_t v = 0;
|
uint64_t v = 0;
|
||||||
int br = 0;
|
int br = 0;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ static int mpc8_probe(AVProbeData *p)
|
|||||||
size = bs_get_v(&bs);
|
size = bs_get_v(&bs);
|
||||||
if (size < 2)
|
if (size < 2)
|
||||||
return 0;
|
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
|
return AVPROBE_SCORE_MAX / 4 - 1; //seems to be valid MPC but no header yet
|
||||||
if (header_found) {
|
if (header_found) {
|
||||||
if (size < 11 || size > 28)
|
if (size < 11 || size > 28)
|
||||||
@@ -108,7 +108,7 @@ static int mpc8_probe(AVProbeData *p)
|
|||||||
|
|
||||||
static inline int64_t gb_get_v(GetBitContext *gb)
|
static inline int64_t gb_get_v(GetBitContext *gb)
|
||||||
{
|
{
|
||||||
int64_t v = 0;
|
uint64_t v = 0;
|
||||||
int bits = 0;
|
int bits = 0;
|
||||||
while(get_bits1(gb) && bits < 64-7){
|
while(get_bits1(gb) && bits < 64-7){
|
||||||
v <<= 7;
|
v <<= 7;
|
||||||
@@ -216,6 +216,10 @@ static int mpc8_read_header(AVFormatContext *s)
|
|||||||
while(!url_feof(pb)){
|
while(!url_feof(pb)){
|
||||||
pos = avio_tell(pb);
|
pos = avio_tell(pb);
|
||||||
mpc8_get_chunk_header(pb, &tag, &size);
|
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)
|
if(tag == TAG_STREAMHDR)
|
||||||
break;
|
break;
|
||||||
mpc8_handle_chunk(s, tag, pos, size);
|
mpc8_handle_chunk(s, tag, pos, size);
|
||||||
|
@@ -354,7 +354,7 @@ static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
|
|||||||
AVStream *st = avctx->streams[mv->stream_index];
|
AVStream *st = avctx->streams[mv->stream_index];
|
||||||
const AVIndexEntry *index;
|
const AVIndexEntry *index;
|
||||||
int frame = mv->frame[mv->stream_index];
|
int frame = mv->frame[mv->stream_index];
|
||||||
int ret;
|
int64_t ret;
|
||||||
uint64_t pos;
|
uint64_t pos;
|
||||||
|
|
||||||
if (frame < st->nb_frames) {
|
if (frame < st->nb_frames) {
|
||||||
|
@@ -44,6 +44,10 @@ typedef struct {
|
|||||||
|
|
||||||
/* in ms */
|
/* in ms */
|
||||||
#define BUFFER_DURATION 0
|
#define BUFFER_DURATION 0
|
||||||
|
/* the header needs at most 7 + 4 + 12 B */
|
||||||
|
#define MAX_HEADER_SIZE (7 + 4 + 12)
|
||||||
|
/* UINT16_MAX is the maximal chunk size */
|
||||||
|
#define MAX_PACKET_SIZE (UINT16_MAX - MAX_HEADER_SIZE)
|
||||||
|
|
||||||
|
|
||||||
static void put_str(AVIOContext *s, const char *tag)
|
static void put_str(AVIOContext *s, const char *tag)
|
||||||
@@ -392,6 +396,10 @@ static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int
|
|||||||
/* Well, I spent some time finding the meaning of these bits. I am
|
/* Well, I spent some time finding the meaning of these bits. I am
|
||||||
not sure I understood everything, but it works !! */
|
not sure I understood everything, but it works !! */
|
||||||
#if 1
|
#if 1
|
||||||
|
if (size > MAX_PACKET_SIZE) {
|
||||||
|
av_log_missing_feature(s, "Muxing packets larger than 64 kB", 0);
|
||||||
|
return AVERROR(ENOSYS);
|
||||||
|
}
|
||||||
write_packet_header(s, stream, size + 7 + (size >= 0x4000)*4, key_frame);
|
write_packet_header(s, stream, size + 7 + (size >= 0x4000)*4, key_frame);
|
||||||
/* bit 7: '1' if final packet of a frame converted in several packets */
|
/* bit 7: '1' if final packet of a frame converted in several packets */
|
||||||
avio_w8(pb, 0x81);
|
avio_w8(pb, 0x81);
|
||||||
|
@@ -656,12 +656,6 @@ fail:
|
|||||||
if (pkt->stream_index == seg->reference_stream_index)
|
if (pkt->stream_index == seg->reference_stream_index)
|
||||||
seg->frame_count++;
|
seg->frame_count++;
|
||||||
|
|
||||||
if (ret < 0) {
|
|
||||||
if (seg->list)
|
|
||||||
avio_close(seg->list_pb);
|
|
||||||
avformat_free_context(oc);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -310,7 +310,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
uint8_t *tmpbuf;
|
uint8_t *tmpbuf;
|
||||||
|
|
||||||
size = avio_rl32(s->pb) - 4;
|
size = avio_rl32(s->pb) - 4;
|
||||||
if (!size || size + 4L > frame_size) {
|
if (!size || size + 4LL > frame_size) {
|
||||||
av_log(s, AV_LOG_ERROR, "Invalid audio part size\n");
|
av_log(s, AV_LOG_ERROR, "Invalid audio part size\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
@@ -180,6 +180,8 @@ static int thp_read_packet(AVFormatContext *s,
|
|||||||
pkt->stream_index = thp->video_stream_index;
|
pkt->stream_index = thp->video_stream_index;
|
||||||
} else {
|
} else {
|
||||||
ret = av_get_packet(pb, pkt, thp->audiosize);
|
ret = av_get_packet(pb, pkt, thp->audiosize);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
if (ret != thp->audiosize) {
|
if (ret != thp->audiosize) {
|
||||||
av_free_packet(pkt);
|
av_free_packet(pkt);
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
@@ -96,8 +96,10 @@ static int tta_read_header(AVFormatContext *s)
|
|||||||
|
|
||||||
for (i = 0; i < c->totalframes; i++) {
|
for (i = 0; i < c->totalframes; i++) {
|
||||||
uint32_t size = avio_rl32(s->pb);
|
uint32_t size = avio_rl32(s->pb);
|
||||||
av_add_index_entry(st, framepos, i * c->frame_size, size, 0,
|
int r;
|
||||||
AVINDEX_KEYFRAME);
|
if ((r = av_add_index_entry(st, framepos, i * c->frame_size, size, 0,
|
||||||
|
AVINDEX_KEYFRAME)) < 0)
|
||||||
|
return r;
|
||||||
framepos += size;
|
framepos += size;
|
||||||
}
|
}
|
||||||
avio_skip(s->pb, 4); // seektable crc
|
avio_skip(s->pb, 4); // seektable crc
|
||||||
@@ -135,6 +137,11 @@ static int tta_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
if (c->currentframe >= c->totalframes)
|
if (c->currentframe >= c->totalframes)
|
||||||
return AVERROR_EOF;
|
return AVERROR_EOF;
|
||||||
|
|
||||||
|
if (st->nb_index_entries < c->totalframes) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Index entry disappeared\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
size = st->index_entries[c->currentframe].size;
|
size = st->index_entries[c->currentframe].size;
|
||||||
|
|
||||||
ret = av_get_packet(s->pb, pkt, size);
|
ret = av_get_packet(s->pb, pkt, size);
|
||||||
|
@@ -2652,8 +2652,8 @@ static int get_std_framerate(int i){
|
|||||||
* And there are "variable" fps files this needs to detect as well.
|
* And there are "variable" fps files this needs to detect as well.
|
||||||
*/
|
*/
|
||||||
static int tb_unreliable(AVCodecContext *c){
|
static int tb_unreliable(AVCodecContext *c){
|
||||||
if( c->time_base.den >= 101L*c->time_base.num
|
if( c->time_base.den >= 101LL*c->time_base.num
|
||||||
|| c->time_base.den < 5L*c->time_base.num
|
|| c->time_base.den < 5LL*c->time_base.num
|
||||||
/* || c->codec_tag == AV_RL32("DIVX")
|
/* || c->codec_tag == AV_RL32("DIVX")
|
||||||
|| c->codec_tag == AV_RL32("XVID")*/
|
|| c->codec_tag == AV_RL32("XVID")*/
|
||||||
|| c->codec_tag == AV_RL32("mp4v")
|
|| c->codec_tag == AV_RL32("mp4v")
|
||||||
|
@@ -262,7 +262,7 @@ static int vqf_read_seek(AVFormatContext *s,
|
|||||||
{
|
{
|
||||||
VqfContext *c = s->priv_data;
|
VqfContext *c = s->priv_data;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
int ret;
|
int64_t ret;
|
||||||
int64_t pos;
|
int64_t pos;
|
||||||
|
|
||||||
st = s->streams[stream_index];
|
st = s->streams[stream_index];
|
||||||
|
@@ -43,11 +43,17 @@
|
|||||||
#elif HAVE_ARMV5TE
|
#elif HAVE_ARMV5TE
|
||||||
.arch armv5te
|
.arch armv5te
|
||||||
#endif
|
#endif
|
||||||
|
#if HAVE_AS_OBJECT_ARCH
|
||||||
|
ELF .object_arch armv4
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAVE_NEON
|
#if HAVE_NEON
|
||||||
.fpu neon
|
.fpu neon
|
||||||
|
ELF .eabi_attribute 10, 0 @ suppress Tag_FP_arch
|
||||||
|
ELF .eabi_attribute 12, 0 @ suppress Tag_Advanced_SIMD_arch
|
||||||
#elif HAVE_VFP
|
#elif HAVE_VFP
|
||||||
.fpu vfp
|
.fpu vfp
|
||||||
|
ELF .eabi_attribute 10, 0 @ suppress Tag_FP_arch
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.syntax unified
|
.syntax unified
|
||||||
|
@@ -571,14 +571,25 @@ static int initFilter(int16_t **outFilter, int32_t **filterPos,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((*filterPos)[i] + filterSize > srcW) {
|
if ((*filterPos)[i] + filterSize > srcW) {
|
||||||
int shift = (*filterPos)[i] + filterSize - srcW;
|
int shift = (*filterPos)[i] + FFMIN(filterSize - srcW, 0);
|
||||||
// move filter coefficients right to compensate for filterPos
|
int64_t acc = 0;
|
||||||
for (j = filterSize - 2; j >= 0; j--) {
|
|
||||||
int right = FFMIN(j + shift, filterSize - 1);
|
for (j = filterSize - 1; j >= 0; j--) {
|
||||||
filter[i * filterSize + right] += filter[i * filterSize + j];
|
if ((*filterPos)[i] + j >= srcW) {
|
||||||
filter[i * filterSize + j] = 0;
|
acc += filter[i * filterSize + j];
|
||||||
|
filter[i * filterSize + j] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
(*filterPos)[i]= srcW - filterSize;
|
for (j = filterSize - 1; j >= 0; j--) {
|
||||||
|
if (j < shift) {
|
||||||
|
filter[i * filterSize + j] = 0;
|
||||||
|
} else {
|
||||||
|
filter[i * filterSize + j] = filter[i * filterSize + j - shift];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(*filterPos)[i]-= shift;
|
||||||
|
filter[i * filterSize + srcW - 1 - (*filterPos)[i]] += acc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1039,7 +1050,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
|
|||||||
c->chrDstW = -((-dstW) >> c->chrDstHSubSample);
|
c->chrDstW = -((-dstW) >> c->chrDstHSubSample);
|
||||||
c->chrDstH = -((-dstH) >> c->chrDstVSubSample);
|
c->chrDstH = -((-dstH) >> c->chrDstVSubSample);
|
||||||
|
|
||||||
FF_ALLOC_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail);
|
FF_ALLOCZ_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail);
|
||||||
|
|
||||||
/* unscaled special cases */
|
/* unscaled special cases */
|
||||||
if (unscaled && !usesHFilter && !usesVFilter &&
|
if (unscaled && !usesHFilter && !usesVFilter &&
|
||||||
|
Reference in New Issue
Block a user