Compare commits
86 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c60caa5769 | ||
![]() |
96e2a4ba74 | ||
![]() |
a9c0f905aa | ||
![]() |
42b7d224bc | ||
![]() |
45bb57e009 | ||
![]() |
ec0f77fbff | ||
![]() |
3aa99bed5d | ||
![]() |
ece0c9c4b0 | ||
![]() |
0da0d7754e | ||
![]() |
c03491d96b | ||
![]() |
237958f8e8 | ||
![]() |
8e17d28863 | ||
![]() |
084102cd47 | ||
![]() |
0d5e626197 | ||
![]() |
6560e61826 | ||
![]() |
71b3f64935 | ||
![]() |
69a92ae397 | ||
![]() |
d723f92dbf | ||
![]() |
11e5106c56 | ||
![]() |
a65573c45d | ||
![]() |
6c28673cb3 | ||
![]() |
5284d17562 | ||
![]() |
01384e3dde | ||
![]() |
2d39d8ffc1 | ||
![]() |
5d33142fd6 | ||
![]() |
7e8b4506e0 | ||
![]() |
96dac432f7 | ||
![]() |
b92ccfefc3 | ||
![]() |
6e45a99a7c | ||
![]() |
d59804bafb | ||
![]() |
35cf24eee9 | ||
![]() |
341cf9ed81 | ||
![]() |
c36f5df34a | ||
![]() |
23b3fe00bb | ||
![]() |
42669252e8 | ||
![]() |
25a9823eb4 | ||
![]() |
a8fd50bb4e | ||
![]() |
9282c96071 | ||
![]() |
aa9d705871 | ||
![]() |
7ddf252c7e | ||
![]() |
1abb0e5639 | ||
![]() |
e5cf4d16c6 | ||
![]() |
e0465d6fcf | ||
![]() |
65889b62b3 | ||
![]() |
7fc97160c2 | ||
![]() |
c4f0f3c52d | ||
![]() |
4865948d2e | ||
![]() |
891376d261 | ||
![]() |
24a5cd720d | ||
![]() |
75f5fe165c | ||
![]() |
665f70209a | ||
![]() |
12c8e4021c | ||
![]() |
f56095c4d7 | ||
![]() |
76601e4ab8 | ||
![]() |
e90d620cb9 | ||
![]() |
0ffa44340f | ||
![]() |
0bd9b78fb6 | ||
![]() |
997bf49b1c | ||
![]() |
e9d85860d0 | ||
![]() |
2144ce08c1 | ||
![]() |
e28c27e25f | ||
![]() |
9b9048a3dd | ||
![]() |
70dc7bb893 | ||
![]() |
b9b97900c1 | ||
![]() |
d49b57fe0f | ||
![]() |
0f1882b9b2 | ||
![]() |
0fc229450f | ||
![]() |
6f02de4ee8 | ||
![]() |
248a2fca90 | ||
![]() |
1482253790 | ||
![]() |
0f578ea705 | ||
![]() |
48443598ed | ||
![]() |
30ffb80dca | ||
![]() |
0a64e9a029 | ||
![]() |
59b2a9ef95 | ||
![]() |
4ce6d65b6f | ||
![]() |
ab4e54f6f6 | ||
![]() |
18342848f7 | ||
![]() |
61a51598e3 | ||
![]() |
abc1fa7c5a | ||
![]() |
f712d3669e | ||
![]() |
ca232ff9b0 | ||
![]() |
b4632cec74 | ||
![]() |
454f6c622c | ||
![]() |
f70ee7d14f | ||
![]() |
c285db74f6 |
@@ -1,6 +1,14 @@
|
|||||||
Entries are sorted chronologically from oldest to youngest within each release,
|
Entries are sorted chronologically from oldest to youngest within each release,
|
||||||
releases are sorted from youngest to oldest.
|
releases are sorted from youngest to oldest.
|
||||||
|
|
||||||
|
version 1.2.8:
|
||||||
|
- proresenc_ks: fix buffer overflow
|
||||||
|
- iff: fix crash
|
||||||
|
- cdgraphics: fix infinite loop
|
||||||
|
- Fix Ticket3804
|
||||||
|
- Fix Ticket3208
|
||||||
|
|
||||||
|
|
||||||
version 1.2:
|
version 1.2:
|
||||||
|
|
||||||
- VDPAU hardware acceleration through normal hwaccel
|
- VDPAU hardware acceleration through normal hwaccel
|
||||||
|
1
configure
vendored
1
configure
vendored
@@ -3750,6 +3750,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
check_ldflags -Wl,--as-needed
|
check_ldflags -Wl,--as-needed
|
||||||
|
check_ldflags -Wl,-z,noexecstack
|
||||||
|
|
||||||
if check_func dlopen; then
|
if check_func dlopen; then
|
||||||
ldl=
|
ldl=
|
||||||
|
@@ -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.2.7
|
PROJECT_NUMBER = 1.2.11
|
||||||
|
|
||||||
# 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
|
||||||
|
@@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
|||||||
int size;
|
int size;
|
||||||
union {
|
union {
|
||||||
uint64_t u64;
|
uint64_t u64;
|
||||||
uint8_t u8[8];
|
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
|
||||||
} tmp;
|
} tmp;
|
||||||
|
|
||||||
tmp.u64 = av_be2ne64(state);
|
tmp.u64 = av_be2ne64(state);
|
||||||
|
@@ -147,7 +147,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
|||||||
int err;
|
int err;
|
||||||
union {
|
union {
|
||||||
uint64_t u64;
|
uint64_t u64;
|
||||||
uint8_t u8[8];
|
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
|
||||||
} tmp = { av_be2ne64(state) };
|
} tmp = { av_be2ne64(state) };
|
||||||
AC3HeaderInfo hdr;
|
AC3HeaderInfo hdr;
|
||||||
GetBitContext gbc;
|
GetBitContext gbc;
|
||||||
|
@@ -260,7 +260,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
|
|||||||
energy_cpl = energy[blk][CPL_CH][bnd];
|
energy_cpl = energy[blk][CPL_CH][bnd];
|
||||||
energy_ch = energy[blk][ch][bnd];
|
energy_ch = energy[blk][ch][bnd];
|
||||||
blk1 = blk+1;
|
blk1 = blk+1;
|
||||||
while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
|
while (blk1 < s->num_blocks && !s->blocks[blk1].new_cpl_coords[ch]) {
|
||||||
if (s->blocks[blk1].cpl_in_use) {
|
if (s->blocks[blk1].cpl_in_use) {
|
||||||
energy_cpl += energy[blk1][CPL_CH][bnd];
|
energy_cpl += energy[blk1][CPL_CH][bnd];
|
||||||
energy_ch += energy[blk1][ch][bnd];
|
energy_ch += energy[blk1][ch][bnd];
|
||||||
|
@@ -361,11 +361,10 @@ static int cdg_decode_frame(AVCodecContext *avctx,
|
|||||||
*got_frame = 1;
|
*got_frame = 1;
|
||||||
} else {
|
} else {
|
||||||
*got_frame = 0;
|
*got_frame = 0;
|
||||||
buf_size = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*(AVFrame *) data = cc->frame;
|
*(AVFrame *) data = cc->frame;
|
||||||
return buf_size;
|
return avpkt->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold int cdg_decode_end(AVCodecContext *avctx)
|
static av_cold int cdg_decode_end(AVCodecContext *avctx)
|
||||||
|
@@ -134,7 +134,7 @@ static int cinepak_decode_vectors (CinepakContext *s, cvid_strip *strip,
|
|||||||
const uint8_t *eod = (data + size);
|
const uint8_t *eod = (data + size);
|
||||||
uint32_t flag, mask;
|
uint32_t flag, mask;
|
||||||
uint8_t *cb0, *cb1, *cb2, *cb3;
|
uint8_t *cb0, *cb1, *cb2, *cb3;
|
||||||
unsigned int x, y;
|
int x, y;
|
||||||
char *ip0, *ip1, *ip2, *ip3;
|
char *ip0, *ip1, *ip2, *ip3;
|
||||||
|
|
||||||
flag = 0;
|
flag = 0;
|
||||||
|
@@ -171,6 +171,10 @@ static inline int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_c
|
|||||||
{
|
{
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
while (!dirac_get_arith_bit(c, follow_ctx)) {
|
while (!dirac_get_arith_bit(c, follow_ctx)) {
|
||||||
|
if (ret >= 0x40000000) {
|
||||||
|
av_log(NULL, AV_LOG_ERROR, "dirac_get_arith_uint overflow\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
ret <<= 1;
|
ret <<= 1;
|
||||||
ret += dirac_get_arith_bit(c, data_ctx);
|
ret += dirac_get_arith_bit(c, data_ctx);
|
||||||
follow_ctx = ff_dirac_next_ctx[follow_ctx];
|
follow_ctx = ff_dirac_next_ctx[follow_ctx];
|
||||||
|
@@ -598,10 +598,10 @@ static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b
|
|||||||
|
|
||||||
top = 0;
|
top = 0;
|
||||||
for (cb_y = 0; cb_y < cb_height; cb_y++) {
|
for (cb_y = 0; cb_y < cb_height; cb_y++) {
|
||||||
bottom = (b->height * (cb_y+1)) / cb_height;
|
bottom = (b->height * (cb_y+1LL)) / cb_height;
|
||||||
left = 0;
|
left = 0;
|
||||||
for (cb_x = 0; cb_x < cb_width; cb_x++) {
|
for (cb_x = 0; cb_x < cb_width; cb_x++) {
|
||||||
right = (b->width * (cb_x+1)) / cb_width;
|
right = (b->width * (cb_x+1LL)) / cb_width;
|
||||||
codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith);
|
codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith);
|
||||||
left = right;
|
left = right;
|
||||||
}
|
}
|
||||||
@@ -990,8 +990,8 @@ static int dirac_unpack_idwt_params(DiracContext *s)
|
|||||||
/* Codeblock parameters (core syntax only) */
|
/* Codeblock parameters (core syntax only) */
|
||||||
if (get_bits1(gb)) {
|
if (get_bits1(gb)) {
|
||||||
for (i = 0; i <= s->wavelet_depth; i++) {
|
for (i = 0; i <= s->wavelet_depth; i++) {
|
||||||
CHECKEDREAD(s->codeblock[i].width , tmp < 1, "codeblock width invalid\n")
|
CHECKEDREAD(s->codeblock[i].width , tmp < 1 || tmp > (s->avctx->width >>s->wavelet_depth-i), "codeblock width invalid\n")
|
||||||
CHECKEDREAD(s->codeblock[i].height, tmp < 1, "codeblock height invalid\n")
|
CHECKEDREAD(s->codeblock[i].height, tmp < 1 || tmp > (s->avctx->height>>s->wavelet_depth-i), "codeblock height invalid\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n")
|
CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n")
|
||||||
|
@@ -39,6 +39,7 @@ typedef struct DNXHDContext {
|
|||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
int64_t cid; ///< compression id
|
int64_t cid; ///< compression id
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
|
enum AVPixelFormat pix_fmt;
|
||||||
unsigned int mb_width, mb_height;
|
unsigned int mb_width, mb_height;
|
||||||
uint32_t mb_scan_index[68]; /* max for 1080p */
|
uint32_t mb_scan_index[68]; /* max for 1080p */
|
||||||
int cur_field; ///< current interlaced field
|
int cur_field; ///< current interlaced field
|
||||||
@@ -135,7 +136,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
|
|||||||
av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
|
av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
|
||||||
|
|
||||||
if (buf[0x21] & 0x40) {
|
if (buf[0x21] & 0x40) {
|
||||||
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
|
ctx->pix_fmt = AV_PIX_FMT_YUV422P10;
|
||||||
ctx->avctx->bits_per_raw_sample = 10;
|
ctx->avctx->bits_per_raw_sample = 10;
|
||||||
if (ctx->bit_depth != 10) {
|
if (ctx->bit_depth != 10) {
|
||||||
ff_dsputil_init(&ctx->dsp, ctx->avctx);
|
ff_dsputil_init(&ctx->dsp, ctx->avctx);
|
||||||
@@ -143,7 +144,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
|
|||||||
ctx->decode_dct_block = dnxhd_decode_dct_block_10;
|
ctx->decode_dct_block = dnxhd_decode_dct_block_10;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
|
ctx->pix_fmt = AV_PIX_FMT_YUV422P;
|
||||||
ctx->avctx->bits_per_raw_sample = 8;
|
ctx->avctx->bits_per_raw_sample = 8;
|
||||||
if (ctx->bit_depth != 8) {
|
if (ctx->bit_depth != 8) {
|
||||||
ff_dsputil_init(&ctx->dsp, ctx->avctx);
|
ff_dsputil_init(&ctx->dsp, ctx->avctx);
|
||||||
@@ -381,9 +382,15 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
avctx->width, avctx->height, ctx->width, ctx->height);
|
avctx->width, avctx->height, ctx->width, ctx->height);
|
||||||
first_field = 1;
|
first_field = 1;
|
||||||
}
|
}
|
||||||
|
if (avctx->pix_fmt != AV_PIX_FMT_NONE && avctx->pix_fmt != ctx->pix_fmt) {
|
||||||
|
av_log(avctx, AV_LOG_WARNING, "pix_fmt changed: %s -> %s\n",
|
||||||
|
av_get_pix_fmt_name(avctx->pix_fmt), av_get_pix_fmt_name(ctx->pix_fmt));
|
||||||
|
first_field = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (av_image_check_size(ctx->width, ctx->height, 0, avctx))
|
if (av_image_check_size(ctx->width, ctx->height, 0, avctx))
|
||||||
return -1;
|
return -1;
|
||||||
|
avctx->pix_fmt = ctx->pix_fmt;
|
||||||
avcodec_set_dimensions(avctx, ctx->width, ctx->height);
|
avcodec_set_dimensions(avctx, ctx->width, ctx->height);
|
||||||
|
|
||||||
if (first_field) {
|
if (first_field) {
|
||||||
|
@@ -350,11 +350,6 @@ static av_cold int dvvideo_init_encoder(AVCodecContext *avctx)
|
|||||||
static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5;
|
static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5;
|
||||||
static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
|
static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
|
||||||
|
|
||||||
static inline int put_bits_left(PutBitContext* s)
|
|
||||||
{
|
|
||||||
return (s->buf_end - s->buf) * 8 - put_bits_count(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if CONFIG_SMALL
|
#if CONFIG_SMALL
|
||||||
/* Converts run and level (where level != 0) pair into VLC, returning bit size */
|
/* Converts run and level (where level != 0) pair into VLC, returning bit size */
|
||||||
static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc)
|
static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc)
|
||||||
|
@@ -45,8 +45,11 @@ static int dvdsub_parse(AVCodecParserContext *s,
|
|||||||
DVDSubParseContext *pc = s->priv_data;
|
DVDSubParseContext *pc = s->priv_data;
|
||||||
|
|
||||||
if (pc->packet_index == 0) {
|
if (pc->packet_index == 0) {
|
||||||
if (buf_size < 2)
|
if (buf_size < 2 || AV_RB16(buf) && buf_size < 6) {
|
||||||
return 0;
|
if (buf_size)
|
||||||
|
av_log(avctx, AV_LOG_DEBUG, "Parser input %d too small\n", buf_size);
|
||||||
|
return buf_size;
|
||||||
|
}
|
||||||
pc->packet_len = AV_RB16(buf);
|
pc->packet_len = AV_RB16(buf);
|
||||||
if (pc->packet_len == 0) /* HD-DVD subpicture packet */
|
if (pc->packet_len == 0) /* HD-DVD subpicture packet */
|
||||||
pc->packet_len = AV_RB32(buf+2);
|
pc->packet_len = AV_RB32(buf+2);
|
||||||
|
@@ -308,6 +308,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
avctx->pix_fmt = AV_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->pic);
|
||||||
avcodec_get_frame_defaults(&c->prev);
|
avcodec_get_frame_defaults(&c->prev);
|
||||||
|
|
||||||
|
@@ -463,10 +463,10 @@ static int decode_frame(FLACContext *s)
|
|||||||
ret = allocate_buffers(s);
|
ret = allocate_buffers(s);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
|
|
||||||
s->got_streaminfo = 1;
|
s->got_streaminfo = 1;
|
||||||
dump_headers(s->avctx, (FLACStreaminfo *)s);
|
dump_headers(s->avctx, (FLACStreaminfo *)s);
|
||||||
}
|
}
|
||||||
|
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
|
||||||
|
|
||||||
// dump_headers(s->avctx, (FLACStreaminfo *)s);
|
// dump_headers(s->avctx, (FLACStreaminfo *)s);
|
||||||
|
|
||||||
|
@@ -253,26 +253,21 @@ static int gif_read_image(GifState *s)
|
|||||||
case 1:
|
case 1:
|
||||||
y1 += 8;
|
y1 += 8;
|
||||||
ptr += linesize * 8;
|
ptr += linesize * 8;
|
||||||
if (y1 >= height) {
|
|
||||||
y1 = pass ? 2 : 4;
|
|
||||||
ptr = ptr1 + linesize * y1;
|
|
||||||
pass++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
y1 += 4;
|
y1 += 4;
|
||||||
ptr += linesize * 4;
|
ptr += linesize * 4;
|
||||||
if (y1 >= height) {
|
|
||||||
y1 = 1;
|
|
||||||
ptr = ptr1 + linesize;
|
|
||||||
pass++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
y1 += 2;
|
y1 += 2;
|
||||||
ptr += linesize * 2;
|
ptr += linesize * 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
while (y1 >= height) {
|
||||||
|
y1 = 4 >> pass;
|
||||||
|
ptr = ptr1 + linesize * y1;
|
||||||
|
pass++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ptr += linesize;
|
ptr += linesize;
|
||||||
}
|
}
|
||||||
|
@@ -417,18 +417,18 @@ int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma)
|
|||||||
|
|
||||||
if ((h->left_samples_available & 0x8080) != 0x8080) {
|
if ((h->left_samples_available & 0x8080) != 0x8080) {
|
||||||
mode = left[mode];
|
mode = left[mode];
|
||||||
if (is_chroma && (h->left_samples_available & 0x8080)) {
|
|
||||||
// mad cow disease mode, aka MBAFF + constrained_intra_pred
|
|
||||||
mode = ALZHEIMER_DC_L0T_PRED8x8 +
|
|
||||||
(!(h->left_samples_available & 0x8000)) +
|
|
||||||
2 * (mode == DC_128_PRED8x8);
|
|
||||||
}
|
|
||||||
if (mode < 0) {
|
if (mode < 0) {
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
"left block unavailable for requested intra mode at %d %d\n",
|
"left block unavailable for requested intra mode at %d %d\n",
|
||||||
h->mb_x, h->mb_y);
|
h->mb_x, h->mb_y);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (is_chroma && (h->left_samples_available & 0x8080)) {
|
||||||
|
// mad cow disease mode, aka MBAFF + constrained_intra_pred
|
||||||
|
mode = ALZHEIMER_DC_L0T_PRED8x8 +
|
||||||
|
(!(h->left_samples_available & 0x8000)) +
|
||||||
|
2 * (mode == DC_128_PRED8x8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return mode;
|
return mode;
|
||||||
@@ -1043,6 +1043,7 @@ static void free_tables(H264Context *h, int free_rbsp)
|
|||||||
av_freep(&h->visualization_buffer[i]);
|
av_freep(&h->visualization_buffer[i]);
|
||||||
|
|
||||||
if (free_rbsp) {
|
if (free_rbsp) {
|
||||||
|
memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
|
||||||
for (i = 0; i < h->picture_count && !h->avctx->internal->is_copy; i++)
|
for (i = 0; i < h->picture_count && !h->avctx->internal->is_copy; i++)
|
||||||
free_picture(h, &h->DPB[i]);
|
free_picture(h, &h->DPB[i]);
|
||||||
av_freep(&h->DPB);
|
av_freep(&h->DPB);
|
||||||
@@ -1600,6 +1601,17 @@ static int decode_update_thread_context(AVCodecContext *dst,
|
|||||||
memset(&h->me, 0, sizeof(h->me));
|
memset(&h->me, 0, sizeof(h->me));
|
||||||
h->avctx = dst;
|
h->avctx = dst;
|
||||||
h->DPB = NULL;
|
h->DPB = NULL;
|
||||||
|
h->intra4x4_pred_mode= NULL;
|
||||||
|
h->non_zero_count = NULL;
|
||||||
|
h->slice_table_base = NULL;
|
||||||
|
h->slice_table = NULL;
|
||||||
|
h->cbp_table = NULL;
|
||||||
|
h->chroma_pred_mode_table = NULL;
|
||||||
|
memset(h->mvd_table, 0, sizeof(h->mvd_table));
|
||||||
|
h->direct_table = NULL;
|
||||||
|
h->list_counts = NULL;
|
||||||
|
h->mb2b_xy = NULL;
|
||||||
|
h->mb2br_xy = NULL;
|
||||||
|
|
||||||
if (h1->context_initialized) {
|
if (h1->context_initialized) {
|
||||||
h->context_initialized = 0;
|
h->context_initialized = 0;
|
||||||
@@ -2420,6 +2432,16 @@ static int pred_weight_table(H264Context *h)
|
|||||||
h->luma_log2_weight_denom = get_ue_golomb(&h->gb);
|
h->luma_log2_weight_denom = get_ue_golomb(&h->gb);
|
||||||
if (h->sps.chroma_format_idc)
|
if (h->sps.chroma_format_idc)
|
||||||
h->chroma_log2_weight_denom = get_ue_golomb(&h->gb);
|
h->chroma_log2_weight_denom = get_ue_golomb(&h->gb);
|
||||||
|
|
||||||
|
if (h->luma_log2_weight_denom > 7U) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is out of range\n", h->luma_log2_weight_denom);
|
||||||
|
h->luma_log2_weight_denom = 0;
|
||||||
|
}
|
||||||
|
if (h->chroma_log2_weight_denom > 7U) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR, "chroma_log2_weight_denom %d is out of range\n", h->chroma_log2_weight_denom);
|
||||||
|
h->chroma_log2_weight_denom = 0;
|
||||||
|
}
|
||||||
|
|
||||||
luma_def = 1 << h->luma_log2_weight_denom;
|
luma_def = 1 << h->luma_log2_weight_denom;
|
||||||
chroma_def = 1 << h->chroma_log2_weight_denom;
|
chroma_def = 1 << h->chroma_log2_weight_denom;
|
||||||
|
|
||||||
|
@@ -255,6 +255,7 @@ typedef struct MMCO {
|
|||||||
* H264Context
|
* H264Context
|
||||||
*/
|
*/
|
||||||
typedef struct H264Context {
|
typedef struct H264Context {
|
||||||
|
AVClass *av_class;
|
||||||
AVCodecContext *avctx;
|
AVCodecContext *avctx;
|
||||||
VideoDSPContext vdsp;
|
VideoDSPContext vdsp;
|
||||||
H264DSPContext h264dsp;
|
H264DSPContext h264dsp;
|
||||||
@@ -969,6 +970,33 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h)
|
|||||||
0x0001000100010001ULL));
|
0x0001000100010001ULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int find_start_code(const uint8_t *buf, int buf_size,
|
||||||
|
int buf_index, int next_avc)
|
||||||
|
{
|
||||||
|
uint32_t state = -1;
|
||||||
|
|
||||||
|
buf_index = avpriv_mpv_find_start_code(buf + buf_index, buf + next_avc + 1, &state) - buf - 1;
|
||||||
|
|
||||||
|
return FFMIN(buf_index, buf_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf,
|
||||||
|
int buf_size, int *buf_index)
|
||||||
|
{
|
||||||
|
int i, nalsize = 0;
|
||||||
|
|
||||||
|
if (*buf_index >= buf_size - h->nal_length_size)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for (i = 0; i < h->nal_length_size; i++)
|
||||||
|
nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++];
|
||||||
|
if (nalsize <= 0 || nalsize > buf_size - *buf_index) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
|
"AVC: nal size %d\n", nalsize);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return nalsize;
|
||||||
|
}
|
||||||
void ff_h264_draw_horiz_band(H264Context *h, int y, int height);
|
void ff_h264_draw_horiz_band(H264Context *h, int y, int height);
|
||||||
|
|
||||||
#endif /* AVCODEC_H264_H */
|
#endif /* AVCODEC_H264_H */
|
||||||
|
@@ -139,10 +139,10 @@ found:
|
|||||||
*/
|
*/
|
||||||
static inline int parse_nal_units(AVCodecParserContext *s,
|
static inline int parse_nal_units(AVCodecParserContext *s,
|
||||||
AVCodecContext *avctx,
|
AVCodecContext *avctx,
|
||||||
const uint8_t *buf, int buf_size)
|
const uint8_t * const buf, int buf_size)
|
||||||
{
|
{
|
||||||
H264Context *h = s->priv_data;
|
H264Context *h = s->priv_data;
|
||||||
const uint8_t *buf_end = buf + buf_size;
|
int buf_index, next_avc;
|
||||||
unsigned int pps_id;
|
unsigned int pps_id;
|
||||||
unsigned int slice_type;
|
unsigned int slice_type;
|
||||||
int state = -1;
|
int state = -1;
|
||||||
@@ -162,26 +162,26 @@ static inline int parse_nal_units(AVCodecParserContext *s,
|
|||||||
if (!buf_size)
|
if (!buf_size)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
buf_index = 0;
|
||||||
|
next_avc = h->is_avc ? 0 : buf_size;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
int src_length, dst_length, consumed, nalsize = 0;
|
int src_length, dst_length, consumed, nalsize = 0;
|
||||||
if (h->is_avc) {
|
|
||||||
int i;
|
if (buf_index >= next_avc) {
|
||||||
if (h->nal_length_size >= buf_end - buf) break;
|
nalsize = get_avc_nalsize(h, buf, buf_size, &buf_index);
|
||||||
nalsize = 0;
|
if (nalsize < 0)
|
||||||
for (i = 0; i < h->nal_length_size; i++)
|
|
||||||
nalsize = (nalsize << 8) | *buf++;
|
|
||||||
if (nalsize <= 0 || nalsize > buf_end - buf) {
|
|
||||||
av_log(h->avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize);
|
|
||||||
break;
|
break;
|
||||||
}
|
next_avc = buf_index + nalsize;
|
||||||
src_length = nalsize;
|
|
||||||
} else {
|
} else {
|
||||||
buf = avpriv_mpv_find_start_code(buf, buf_end, &state);
|
buf_index = find_start_code(buf, buf_size, buf_index, next_avc);
|
||||||
if(buf >= buf_end)
|
if (buf_index >= buf_size)
|
||||||
break;
|
break;
|
||||||
--buf;
|
if (buf_index >= next_avc)
|
||||||
src_length = buf_end - buf;
|
continue;
|
||||||
}
|
}
|
||||||
|
src_length = next_avc - buf_index;
|
||||||
|
|
||||||
|
state = buf[buf_index];
|
||||||
switch (state & 0x1f) {
|
switch (state & 0x1f) {
|
||||||
case NAL_SLICE:
|
case NAL_SLICE:
|
||||||
case NAL_IDR_SLICE:
|
case NAL_IDR_SLICE:
|
||||||
@@ -190,10 +190,12 @@ static inline int parse_nal_units(AVCodecParserContext *s,
|
|||||||
src_length = 20;
|
src_length = 20;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ptr= ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length);
|
ptr= ff_h264_decode_nal(h, buf + buf_index, &dst_length, &consumed, src_length);
|
||||||
if (ptr==NULL || dst_length < 0)
|
if (ptr==NULL || dst_length < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
buf_index += consumed;
|
||||||
|
|
||||||
init_get_bits(&h->gb, ptr, 8*dst_length);
|
init_get_bits(&h->gb, ptr, 8*dst_length);
|
||||||
switch(h->nal_unit_type) {
|
switch(h->nal_unit_type) {
|
||||||
case NAL_SPS:
|
case NAL_SPS:
|
||||||
@@ -277,7 +279,6 @@ static inline int parse_nal_units(AVCodecParserContext *s,
|
|||||||
|
|
||||||
return 0; /* no need to evaluate the rest */
|
return 0; /* no need to evaluate the rest */
|
||||||
}
|
}
|
||||||
buf += h->is_avc ? nalsize : consumed;
|
|
||||||
}
|
}
|
||||||
if (q264)
|
if (q264)
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -832,9 +832,9 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
bytestream2_init(&gb, buf, buf_size);
|
bytestream2_init(&gb, buf, buf_size);
|
||||||
if (avctx->codec_tag == MKTAG('R','G','B','8'))
|
if (avctx->codec_tag == MKTAG('R','G','B','8') && avctx->pix_fmt == AV_PIX_FMT_RGB32)
|
||||||
decode_rgb8(&gb, s->frame.data[0], avctx->width, avctx->height, s->frame.linesize[0]);
|
decode_rgb8(&gb, s->frame.data[0], avctx->width, avctx->height, s->frame.linesize[0]);
|
||||||
else if (avctx->codec_tag == MKTAG('R','G','B','N'))
|
else if (avctx->codec_tag == MKTAG('R','G','B','N') && avctx->pix_fmt == AV_PIX_FMT_RGB444)
|
||||||
decode_rgbn(&gb, s->frame.data[0], avctx->width, avctx->height, s->frame.linesize[0]);
|
decode_rgbn(&gb, s->frame.data[0], avctx->width, avctx->height, s->frame.linesize[0]);
|
||||||
else
|
else
|
||||||
return unsupported(avctx);
|
return unsupported(avctx);
|
||||||
|
@@ -95,7 +95,7 @@ typedef struct Indeo3DecodeContext {
|
|||||||
|
|
||||||
int16_t width, height;
|
int16_t width, height;
|
||||||
uint32_t frame_num; ///< current frame number (zero-based)
|
uint32_t frame_num; ///< current frame number (zero-based)
|
||||||
uint32_t data_size; ///< size of the frame data in bytes
|
int data_size; ///< size of the frame data in bytes
|
||||||
uint16_t frame_flags; ///< frame properties
|
uint16_t frame_flags; ///< frame properties
|
||||||
uint8_t cb_offset; ///< needed for selecting VQ tables
|
uint8_t cb_offset; ///< needed for selecting VQ tables
|
||||||
uint8_t buf_sel; ///< active frame buffer: 0 - primary, 1 -secondary
|
uint8_t buf_sel; ///< active frame buffer: 0 - primary, 1 -secondary
|
||||||
@@ -897,7 +897,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
const uint8_t *buf_ptr = buf, *bs_hdr;
|
const uint8_t *buf_ptr = buf, *bs_hdr;
|
||||||
uint32_t frame_num, word2, check_sum, data_size;
|
uint32_t frame_num, word2, check_sum, data_size;
|
||||||
uint32_t y_offset, u_offset, v_offset, starts[3], ends[3];
|
int y_offset, u_offset, v_offset;
|
||||||
|
uint32_t starts[3], ends[3];
|
||||||
uint16_t height, width;
|
uint16_t height, width;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@@ -977,7 +978,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
|||||||
ctx->y_data_size = ends[0] - starts[0];
|
ctx->y_data_size = ends[0] - starts[0];
|
||||||
ctx->v_data_size = ends[1] - starts[1];
|
ctx->v_data_size = ends[1] - starts[1];
|
||||||
ctx->u_data_size = ends[2] - starts[2];
|
ctx->u_data_size = ends[2] - starts[2];
|
||||||
if (FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
|
if (FFMIN3(y_offset, v_offset, u_offset) < 0 ||
|
||||||
|
FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
|
||||||
FFMIN3(ctx->y_data_size, ctx->v_data_size, ctx->u_data_size) <= 0) {
|
FFMIN3(ctx->y_data_size, ctx->v_data_size, ctx->u_data_size) <= 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n");
|
av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
@@ -207,6 +207,11 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
|
|||||||
x += stride;
|
x += stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (x >= w) {
|
||||||
|
av_log(NULL, AV_LOG_ERROR, "run overflow\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* decode run termination value */
|
/* decode run termination value */
|
||||||
Rb = R(last, x);
|
Rb = R(last, x);
|
||||||
RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;
|
RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;
|
||||||
|
@@ -98,8 +98,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->data[0],
|
WebRtcIlbcfix_DecodeImpl((int16_t *) frame->data[0], (const uint16_t *) buf, &s->decoder, 1);
|
||||||
(const WebRtc_UWord16*) buf, &s->decoder, 1);
|
|
||||||
|
|
||||||
*got_frame_ptr = 1;
|
*got_frame_ptr = 1;
|
||||||
|
|
||||||
@@ -185,7 +184,7 @@ static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) < 0)
|
if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
WebRtcIlbcfix_EncodeImpl((WebRtc_UWord16*) avpkt->data, (const WebRtc_Word16*) frame->data[0], &s->encoder);
|
WebRtcIlbcfix_EncodeImpl((uint16_t *) avpkt->data, (const int16_t *) frame->data[0], &s->encoder);
|
||||||
|
|
||||||
avpkt->size = s->encoder.no_of_bytes;
|
avpkt->size = s->encoder.no_of_bytes;
|
||||||
*got_packet_ptr = 1;
|
*got_packet_ptr = 1;
|
||||||
|
@@ -211,7 +211,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
|
|||||||
|
|
||||||
int ff_mjpeg_decode_sof(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;
|
||||||
int h_count[MAX_COMPONENTS];
|
int h_count[MAX_COMPONENTS];
|
||||||
int v_count[MAX_COMPONENTS];
|
int v_count[MAX_COMPONENTS];
|
||||||
|
|
||||||
@@ -220,14 +220,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
|
|
||||||
/* XXX: verify len field validity */
|
/* XXX: verify len field validity */
|
||||||
len = get_bits(&s->gb, 16);
|
len = get_bits(&s->gb, 16);
|
||||||
s->bits = get_bits(&s->gb, 8);
|
bits = get_bits(&s->gb, 8);
|
||||||
|
|
||||||
if (s->pegasus_rct)
|
if (s->pegasus_rct)
|
||||||
s->bits = 9;
|
bits = 9;
|
||||||
if (s->bits == 9 && !s->pegasus_rct)
|
if (bits == 9 && !s->pegasus_rct)
|
||||||
s->rct = 1; // FIXME ugly
|
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");
|
av_log(s->avctx, AV_LOG_ERROR, "only 8 bits/component accepted\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -258,7 +258,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s->ls && !(s->bits <= 8 || nb_components == 1)) {
|
if (s->ls && !(bits <= 8 || nb_components == 1)) {
|
||||||
av_log_missing_feature(s->avctx,
|
av_log_missing_feature(s->avctx,
|
||||||
"For JPEG-LS anything except <= 8 bits/component"
|
"For JPEG-LS anything except <= 8 bits/component"
|
||||||
" or 16-bit gray", 0);
|
" or 16-bit gray", 0);
|
||||||
@@ -301,12 +301,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
|
|
||||||
/* if different size, realloc/alloc picture */
|
/* if different size, realloc/alloc picture */
|
||||||
if ( width != s->width || height != s->height
|
if ( width != s->width || height != s->height
|
||||||
|
|| bits != s->bits
|
||||||
|| memcmp(s->h_count, h_count, sizeof(h_count))
|
|| memcmp(s->h_count, h_count, sizeof(h_count))
|
||||||
|| memcmp(s->v_count, v_count, sizeof(v_count))) {
|
|| memcmp(s->v_count, v_count, sizeof(v_count))) {
|
||||||
av_freep(&s->qscale_table);
|
av_freep(&s->qscale_table);
|
||||||
|
|
||||||
s->width = width;
|
s->width = width;
|
||||||
s->height = height;
|
s->height = height;
|
||||||
|
s->bits = bits;
|
||||||
memcpy(s->h_count, h_count, sizeof(h_count));
|
memcpy(s->h_count, h_count, sizeof(h_count));
|
||||||
memcpy(s->v_count, v_count, sizeof(v_count));
|
memcpy(s->v_count, v_count, sizeof(v_count));
|
||||||
s->interlaced = 0;
|
s->interlaced = 0;
|
||||||
@@ -1435,6 +1437,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (id == AV_RB32("LJIF")) {
|
if (id == AV_RB32("LJIF")) {
|
||||||
|
int rgb = s->rgb;
|
||||||
|
int pegasus_rct = s->pegasus_rct;
|
||||||
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
|
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
|
||||||
av_log(s->avctx, AV_LOG_INFO,
|
av_log(s->avctx, AV_LOG_INFO,
|
||||||
"Pegasus lossless jpeg header found\n");
|
"Pegasus lossless jpeg header found\n");
|
||||||
@@ -1444,17 +1448,27 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
|
|||||||
skip_bits(&s->gb, 16); /* unknown always 0? */
|
skip_bits(&s->gb, 16); /* unknown always 0? */
|
||||||
switch (get_bits(&s->gb, 8)) {
|
switch (get_bits(&s->gb, 8)) {
|
||||||
case 1:
|
case 1:
|
||||||
s->rgb = 1;
|
rgb = 1;
|
||||||
s->pegasus_rct = 0;
|
pegasus_rct = 0;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
s->rgb = 1;
|
rgb = 1;
|
||||||
s->pegasus_rct = 1;
|
pegasus_rct = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace\n");
|
av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
len -= 9;
|
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;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -109,7 +109,7 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
|
|||||||
|
|
||||||
if (color) {
|
if (color) {
|
||||||
memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
|
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);
|
memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length);
|
||||||
}
|
}
|
||||||
x+= run_length;
|
x+= run_length;
|
||||||
|
@@ -189,7 +189,13 @@ static av_always_inline int cmp_inline(MpegEncContext *s, const int x, const int
|
|||||||
int uvdxy; /* no, it might not be used uninitialized */
|
int uvdxy; /* no, it might not be used uninitialized */
|
||||||
if(dxy){
|
if(dxy){
|
||||||
if(qpel){
|
if(qpel){
|
||||||
|
if (h << size == 16) {
|
||||||
c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); //FIXME prototype (add h)
|
c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); //FIXME prototype (add h)
|
||||||
|
} else if (size == 0 && h == 8) {
|
||||||
|
c->qpel_put[1][dxy](c->temp , ref[0] + x + y*stride , stride);
|
||||||
|
c->qpel_put[1][dxy](c->temp + 8, ref[0] + x + y*stride + 8, stride);
|
||||||
|
} else
|
||||||
|
av_assert2(0);
|
||||||
if(chroma){
|
if(chroma){
|
||||||
int cx= hx/2;
|
int cx= hx/2;
|
||||||
int cy= hy/2;
|
int cy= hy/2;
|
||||||
|
@@ -1086,6 +1086,9 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s)
|
|||||||
{
|
{
|
||||||
int i, err = 0;
|
int i, err = 0;
|
||||||
|
|
||||||
|
if (!s->context_initialized)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
if (s->slice_context_count > 1) {
|
if (s->slice_context_count > 1) {
|
||||||
for (i = 0; i < s->slice_context_count; i++) {
|
for (i = 0; i < s->slice_context_count; i++) {
|
||||||
free_duplicate_context(s->thread_context[i]);
|
free_duplicate_context(s->thread_context[i]);
|
||||||
@@ -1114,8 +1117,8 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s)
|
|||||||
s->mb_height = (s->height + 15) / 16;
|
s->mb_height = (s->height + 15) / 16;
|
||||||
|
|
||||||
if ((s->width || s->height) &&
|
if ((s->width || s->height) &&
|
||||||
av_image_check_size(s->width, s->height, 0, s->avctx))
|
(err = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0)
|
||||||
return AVERROR_INVALIDDATA;
|
goto fail;
|
||||||
|
|
||||||
if ((err = init_context_frame(s)))
|
if ((err = init_context_frame(s)))
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -1131,7 +1134,7 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < nb_slices; i++) {
|
for (i = 0; i < nb_slices; i++) {
|
||||||
if (init_duplicate_context(s->thread_context[i]) < 0)
|
if ((err = init_duplicate_context(s->thread_context[i])) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
s->thread_context[i]->start_mb_y =
|
s->thread_context[i]->start_mb_y =
|
||||||
(s->mb_height * (i) + nb_slices / 2) / nb_slices;
|
(s->mb_height * (i) + nb_slices / 2) / nb_slices;
|
||||||
|
@@ -102,8 +102,8 @@ static const AVOption options[]={
|
|||||||
{"extradata_size", NULL, OFFSET(extradata_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
{"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 }, INT_MIN, 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},
|
||||||
{"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|D|E},
|
{"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
|
||||||
{"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
|
{"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
|
||||||
{"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
|
{"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
|
||||||
{"frame_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
{"frame_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
||||||
|
@@ -563,6 +563,12 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
case MKTAG('I', 'H', 'D', 'R'):
|
case MKTAG('I', 'H', 'D', 'R'):
|
||||||
if (length != 13)
|
if (length != 13)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
if (s->state & PNG_IDAT) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "IHDR after IDAT\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
s->width = bytestream2_get_be32(&s->gb);
|
s->width = bytestream2_get_be32(&s->gb);
|
||||||
s->height = bytestream2_get_be32(&s->gb);
|
s->height = bytestream2_get_be32(&s->gb);
|
||||||
if (av_image_check_size(s->width, s->height, 0, avctx)) {
|
if (av_image_check_size(s->width, s->height, 0, avctx)) {
|
||||||
@@ -631,7 +637,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
} else if ((s->bits_per_pixel == 1 || s->bits_per_pixel == 2 || s->bits_per_pixel == 4 || s->bits_per_pixel == 8) &&
|
} else if ((s->bits_per_pixel == 1 || s->bits_per_pixel == 2 || s->bits_per_pixel == 4 || s->bits_per_pixel == 8) &&
|
||||||
s->color_type == PNG_COLOR_TYPE_PALETTE) {
|
s->color_type == PNG_COLOR_TYPE_PALETTE) {
|
||||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||||
} else if (s->bit_depth == 1) {
|
} else if (s->bit_depth == 1 && s->bits_per_pixel == 1) {
|
||||||
avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
|
avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
|
||||||
} else if (s->bit_depth == 8 &&
|
} else if (s->bit_depth == 8 &&
|
||||||
s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
|
s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
|
||||||
@@ -842,9 +848,10 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
int i, j;
|
int i, j;
|
||||||
uint8_t *pd = s->current_picture->data[0];
|
uint8_t *pd = s->current_picture->data[0];
|
||||||
uint8_t *pd_last = s->last_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 (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[i] += pd_last[i];
|
||||||
}
|
}
|
||||||
pd += s->image_linesize;
|
pd += s->image_linesize;
|
||||||
|
@@ -456,6 +456,11 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
|
|||||||
num_cblocks, plane_factor,
|
num_cblocks, plane_factor,
|
||||||
qmat);
|
qmat);
|
||||||
total_size += sizes[i];
|
total_size += sizes[i];
|
||||||
|
if (put_bits_left(pb) < 0) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Serious underevaluation of"
|
||||||
|
"required buffer size");
|
||||||
|
return AVERROR_BUFFER_TOO_SMALL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return total_size;
|
return total_size;
|
||||||
}
|
}
|
||||||
@@ -754,9 +759,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
|
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
|
||||||
avctx->coded_frame->key_frame = 1;
|
avctx->coded_frame->key_frame = 1;
|
||||||
|
|
||||||
pkt_size = ctx->frame_size_upper_bound + FF_MIN_BUFFER_SIZE;
|
pkt_size = ctx->frame_size_upper_bound;
|
||||||
|
|
||||||
if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0)
|
if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size + FF_MIN_BUFFER_SIZE)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
orig_buf = pkt->data;
|
orig_buf = pkt->data;
|
||||||
@@ -833,7 +838,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
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)) * 8);
|
||||||
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)
|
||||||
|
return ret;
|
||||||
|
|
||||||
bytestream_put_byte(&slice_hdr, q);
|
bytestream_put_byte(&slice_hdr, q);
|
||||||
slice_size = slice_hdr_size + sizes[ctx->num_planes - 1];
|
slice_size = slice_hdr_size + sizes[ctx->num_planes - 1];
|
||||||
|
@@ -75,6 +75,14 @@ static inline int put_bits_count(PutBitContext *s)
|
|||||||
return (s->buf_ptr - s->buf) * 8 + 32 - s->bit_left;
|
return (s->buf_ptr - s->buf) * 8 + 32 - s->bit_left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the number of bits available in the bitstream.
|
||||||
|
*/
|
||||||
|
static inline int put_bits_left(PutBitContext* s)
|
||||||
|
{
|
||||||
|
return (s->buf_end - s->buf_ptr) * 8 - 32 + s->bit_left;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pad the end of the output stream with zeros.
|
* Pad the end of the output stream with zeros.
|
||||||
*/
|
*/
|
||||||
|
@@ -163,7 +163,7 @@ static void qpeg_decode_inter(QpegContext *qctx, uint8_t *dst,
|
|||||||
|
|
||||||
/* check motion vector */
|
/* check motion vector */
|
||||||
if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
|
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))
|
(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",
|
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);
|
me_x, me_y, me_w, me_h, filled, height);
|
||||||
|
@@ -34,7 +34,6 @@
|
|||||||
#include "celp_filters.h"
|
#include "celp_filters.h"
|
||||||
#include "ra144.h"
|
#include "ra144.h"
|
||||||
|
|
||||||
|
|
||||||
static av_cold int ra144_encode_close(AVCodecContext *avctx)
|
static av_cold int ra144_encode_close(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
RA144Context *ractx = avctx->priv_data;
|
RA144Context *ractx = avctx->priv_data;
|
||||||
|
@@ -69,7 +69,7 @@ typedef struct SmcContext {
|
|||||||
row_ptr += stride * 4; \
|
row_ptr += stride * 4; \
|
||||||
} \
|
} \
|
||||||
total_blocks--; \
|
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"); \
|
av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
|
||||||
return; \
|
return; \
|
||||||
|
@@ -652,7 +652,10 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
|
|||||||
if(v){
|
if(v){
|
||||||
v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1);
|
v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1);
|
||||||
v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3*ff_quant3bA[t&0xFF]]);
|
v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3*ff_quant3bA[t&0xFF]]);
|
||||||
|
if ((uint16_t)v != v) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n");
|
||||||
|
v = 1;
|
||||||
|
}
|
||||||
xc->x=x;
|
xc->x=x;
|
||||||
(xc++)->coeff= v;
|
(xc++)->coeff= v;
|
||||||
}
|
}
|
||||||
@@ -662,6 +665,10 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
|
|||||||
else run= INT_MAX;
|
else run= INT_MAX;
|
||||||
v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1);
|
v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1);
|
||||||
v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]);
|
v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]);
|
||||||
|
if ((uint16_t)v != v) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n");
|
||||||
|
v = 1;
|
||||||
|
}
|
||||||
|
|
||||||
xc->x=x;
|
xc->x=x;
|
||||||
(xc++)->coeff= v;
|
(xc++)->coeff= v;
|
||||||
|
@@ -497,7 +497,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, DSPContext *dsp,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out)
|
static void svq1_parse_string(GetBitContext *bitbuf, uint8_t out[257])
|
||||||
{
|
{
|
||||||
uint8_t seed;
|
uint8_t seed;
|
||||||
int i;
|
int i;
|
||||||
@@ -509,6 +509,7 @@ static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out)
|
|||||||
out[i] = get_bits(bitbuf, 8) ^ seed;
|
out[i] = get_bits(bitbuf, 8) ^ seed;
|
||||||
seed = string_table[out[i] ^ seed];
|
seed = string_table[out[i] ^ seed];
|
||||||
}
|
}
|
||||||
|
out[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
|
static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
|
||||||
@@ -551,12 +552,12 @@ static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((s->frame_code ^ 0x10) >= 0x50) {
|
if ((s->frame_code ^ 0x10) >= 0x50) {
|
||||||
uint8_t msg[256];
|
uint8_t msg[257];
|
||||||
|
|
||||||
svq1_parse_string(bitbuf, msg);
|
svq1_parse_string(bitbuf, msg);
|
||||||
|
|
||||||
av_log(avctx, AV_LOG_INFO,
|
av_log(avctx, AV_LOG_INFO,
|
||||||
"embedded message: \"%s\"\n", (char *)msg);
|
"embedded message: \"%s\"\n", ((char *)msg) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
skip_bits(bitbuf, 2);
|
skip_bits(bitbuf, 2);
|
||||||
|
@@ -716,13 +716,13 @@ static int tiff_decode_tag(TiffContext *s)
|
|||||||
s->height = value;
|
s->height = value;
|
||||||
break;
|
break;
|
||||||
case TIFF_BPP:
|
case TIFF_BPP:
|
||||||
s->bppcount = count;
|
if (count > 4U) {
|
||||||
if (count > 4) {
|
|
||||||
av_log(s->avctx, AV_LOG_ERROR,
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
"This format is not supported (bpp=%d, %d components)\n",
|
"This format is not supported (bpp=%d, %d components)\n",
|
||||||
s->bpp, count);
|
value, count);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
s->bppcount = count;
|
||||||
if (count == 1)
|
if (count == 1)
|
||||||
s->bpp = value;
|
s->bpp = value;
|
||||||
else {
|
else {
|
||||||
@@ -743,6 +743,13 @@ 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) {
|
||||||
|
@@ -193,6 +193,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
|||||||
int i;
|
int i;
|
||||||
int w_align = 1;
|
int w_align = 1;
|
||||||
int h_align = 1;
|
int h_align = 1;
|
||||||
|
AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt);
|
||||||
|
|
||||||
|
if (desc) {
|
||||||
|
w_align = 1 << desc->log2_chroma_w;
|
||||||
|
h_align = 1 << desc->log2_chroma_h;
|
||||||
|
}
|
||||||
|
|
||||||
switch (s->pix_fmt) {
|
switch (s->pix_fmt) {
|
||||||
case AV_PIX_FMT_YUV420P:
|
case AV_PIX_FMT_YUV420P:
|
||||||
@@ -244,6 +250,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
|||||||
case AV_PIX_FMT_GBRP12BE:
|
case AV_PIX_FMT_GBRP12BE:
|
||||||
case AV_PIX_FMT_GBRP14LE:
|
case AV_PIX_FMT_GBRP14LE:
|
||||||
case AV_PIX_FMT_GBRP14BE:
|
case AV_PIX_FMT_GBRP14BE:
|
||||||
|
case AV_PIX_FMT_GBRP16LE:
|
||||||
|
case AV_PIX_FMT_GBRP16BE:
|
||||||
w_align = 16; //FIXME assume 16 pixel per macroblock
|
w_align = 16; //FIXME assume 16 pixel per macroblock
|
||||||
h_align = 16 * 2; // interlaced needs 2 macroblocks height
|
h_align = 16 * 2; // interlaced needs 2 macroblocks height
|
||||||
break;
|
break;
|
||||||
@@ -272,6 +280,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
|||||||
w_align = 4;
|
w_align = 4;
|
||||||
h_align = 4;
|
h_align = 4;
|
||||||
}
|
}
|
||||||
|
if (s->codec_id == AV_CODEC_ID_JV) {
|
||||||
|
w_align = 8;
|
||||||
|
h_align = 8;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case AV_PIX_FMT_BGR24:
|
case AV_PIX_FMT_BGR24:
|
||||||
if ((s->codec_id == AV_CODEC_ID_MSZH) ||
|
if ((s->codec_id == AV_CODEC_ID_MSZH) ||
|
||||||
@@ -287,8 +299,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
w_align = 1;
|
|
||||||
h_align = 1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2866,6 +2876,11 @@ int avpriv_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf)
|
|||||||
ret = av_bprint_finalize(buf, &str);
|
ret = av_bprint_finalize(buf, &str);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
if (!av_bprint_is_complete(buf)) {
|
||||||
|
av_free(str);
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
|
|
||||||
avctx->extradata = str;
|
avctx->extradata = str;
|
||||||
/* Note: the string is NUL terminated (so extradata can be read as a
|
/* Note: the string is NUL terminated (so extradata can be read as a
|
||||||
* string), but the ending character is not accounted in the size (in
|
* string), but the ending character is not accounted in the size (in
|
||||||
|
@@ -212,6 +212,8 @@ static void restore_median(uint8_t *src, int step, int stride,
|
|||||||
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
||||||
slice_start;
|
slice_start;
|
||||||
|
|
||||||
|
if (!slice_height)
|
||||||
|
continue;
|
||||||
bsrc = src + slice_start * stride;
|
bsrc = src + slice_start * stride;
|
||||||
|
|
||||||
// first line - left neighbour prediction
|
// first line - left neighbour prediction
|
||||||
@@ -222,7 +224,7 @@ static void restore_median(uint8_t *src, int step, int stride,
|
|||||||
A = bsrc[i];
|
A = bsrc[i];
|
||||||
}
|
}
|
||||||
bsrc += stride;
|
bsrc += stride;
|
||||||
if (slice_height == 1)
|
if (slice_height <= 1)
|
||||||
continue;
|
continue;
|
||||||
// second line - first element has top prediction, the rest uses median
|
// second line - first element has top prediction, the rest uses median
|
||||||
C = bsrc[-stride];
|
C = bsrc[-stride];
|
||||||
@@ -267,6 +269,8 @@ static void restore_median_il(uint8_t *src, int step, int stride,
|
|||||||
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
||||||
slice_start;
|
slice_start;
|
||||||
slice_height >>= 1;
|
slice_height >>= 1;
|
||||||
|
if (!slice_height)
|
||||||
|
continue;
|
||||||
|
|
||||||
bsrc = src + slice_start * stride;
|
bsrc = src + slice_start * stride;
|
||||||
|
|
||||||
@@ -282,7 +286,7 @@ static void restore_median_il(uint8_t *src, int step, int stride,
|
|||||||
A = bsrc[stride + i];
|
A = bsrc[stride + i];
|
||||||
}
|
}
|
||||||
bsrc += stride2;
|
bsrc += stride2;
|
||||||
if (slice_height == 1)
|
if (slice_height <= 1)
|
||||||
continue;
|
continue;
|
||||||
// second line - first element has top prediction, the rest uses median
|
// second line - first element has top prediction, the rest uses median
|
||||||
C = bsrc[-stride2];
|
C = bsrc[-stride2];
|
||||||
|
@@ -343,7 +343,7 @@ static void vmd_decode(VmdVideoContext *s)
|
|||||||
if (*pb++ == 0xFF)
|
if (*pb++ == 0xFF)
|
||||||
len = rle_unpack(pb, pb_end - pb, len, &dp[ofs], frame_width - ofs);
|
len = rle_unpack(pb, pb_end - pb, len, &dp[ofs], frame_width - ofs);
|
||||||
else {
|
else {
|
||||||
if (pb_end - pb < len)
|
if (ofs + len > frame_width || pb_end - pb < len)
|
||||||
return;
|
return;
|
||||||
memcpy(&dp[ofs], pb, len);
|
memcpy(&dp[ofs], pb, len);
|
||||||
}
|
}
|
||||||
|
@@ -409,6 +409,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
offset &= ~3;
|
offset &= ~3;
|
||||||
if (offset > s->sfb_offsets[i][band - 1])
|
if (offset > s->sfb_offsets[i][band - 1])
|
||||||
s->sfb_offsets[i][band++] = offset;
|
s->sfb_offsets[i][band++] = offset;
|
||||||
|
|
||||||
|
if (offset >= subframe_len)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
s->sfb_offsets[i][band - 1] = subframe_len;
|
s->sfb_offsets[i][band - 1] = subframe_len;
|
||||||
s->num_sfb[i] = band - 1;
|
s->num_sfb[i] = band - 1;
|
||||||
|
@@ -61,6 +61,9 @@ cglobal scalarproduct_int16, 3,3,3, v1, v2, order
|
|||||||
%endif
|
%endif
|
||||||
paddd m2, m0
|
paddd m2, m0
|
||||||
movd eax, m2
|
movd eax, m2
|
||||||
|
%if mmsize == 8
|
||||||
|
emms
|
||||||
|
%endif
|
||||||
RET
|
RET
|
||||||
|
|
||||||
; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)
|
; int scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3, int order, int mul)
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
* Copyright (c) 2002 Steve O'Hara-Smith
|
* Copyright (c) 2002 Steve O'Hara-Smith
|
||||||
* based on
|
* based on
|
||||||
* Linux video grab interface
|
* Linux video grab interface
|
||||||
* Copyright (c) 2000,2001 Gerard Lantau
|
* Copyright (c) 2000, 2001 Fabrice Bellard
|
||||||
* and
|
* and
|
||||||
* simple_grab.c Copyright (c) 1999 Roger Hardiman
|
* simple_grab.c Copyright (c) 1999 Roger Hardiman
|
||||||
*
|
*
|
||||||
|
@@ -51,8 +51,10 @@ static int ape_tag_read_field(AVFormatContext *s)
|
|||||||
av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
|
av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (size >= UINT_MAX)
|
if (size > INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
|
||||||
return -1;
|
av_log(s, AV_LOG_ERROR, "APE tag size too large.\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
if (flags & APE_TAG_FLAG_IS_BINARY) {
|
if (flags & APE_TAG_FLAG_IS_BINARY) {
|
||||||
uint8_t filename[1024];
|
uint8_t filename[1024];
|
||||||
enum AVCodecID id;
|
enum AVCodecID id;
|
||||||
|
@@ -216,6 +216,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
|
|||||||
return offset1;
|
return offset1;
|
||||||
offset += offset1;
|
offset += offset1;
|
||||||
}
|
}
|
||||||
|
if (offset < 0)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
offset1 = offset - pos;
|
offset1 = offset - pos;
|
||||||
if (!s->must_flush && (!s->direct || !s->seek) &&
|
if (!s->must_flush && (!s->direct || !s->seek) &&
|
||||||
offset1 >= 0 && offset1 <= (s->buf_end - s->buffer)) {
|
offset1 >= 0 && offset1 <= (s->buf_end - s->buffer)) {
|
||||||
|
@@ -305,9 +305,10 @@ static int hls_write_trailer(struct AVFormatContext *s)
|
|||||||
|
|
||||||
av_write_trailer(oc);
|
av_write_trailer(oc);
|
||||||
avio_closep(&oc->pb);
|
avio_closep(&oc->pb);
|
||||||
avformat_free_context(oc);
|
|
||||||
av_free(hls->basename);
|
av_free(hls->basename);
|
||||||
append_entry(hls, hls->duration);
|
append_entry(hls, hls->duration);
|
||||||
|
avformat_free_context(oc);
|
||||||
|
hls->avf = NULL;
|
||||||
hls_window(s, 1);
|
hls_window(s, 1);
|
||||||
|
|
||||||
free_entries(hls);
|
free_entries(hls);
|
||||||
|
@@ -162,6 +162,7 @@ typedef struct MOVContext {
|
|||||||
int use_absolute_path;
|
int use_absolute_path;
|
||||||
int ignore_editlist;
|
int ignore_editlist;
|
||||||
int64_t next_root_atom; ///< offset of the next root atom
|
int64_t next_root_atom; ///< offset of the next root atom
|
||||||
|
int atom_depth;
|
||||||
} MOVContext;
|
} MOVContext;
|
||||||
|
|
||||||
int ff_mp4_read_descr_len(AVIOContext *pb);
|
int ff_mp4_read_descr_len(AVIOContext *pb);
|
||||||
|
@@ -33,13 +33,15 @@ static int mpeg4video_probe(AVProbeData *probe_packet)
|
|||||||
|
|
||||||
for(i=0; i<probe_packet->buf_size; i++){
|
for(i=0; i<probe_packet->buf_size; i++){
|
||||||
temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
|
temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
|
||||||
if ((temp_buffer & 0xffffff00) != 0x100)
|
if (temp_buffer & 0xfffffe00)
|
||||||
|
continue;
|
||||||
|
if (temp_buffer < 2)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (temp_buffer == VOP_START_CODE) VOP++;
|
if (temp_buffer == VOP_START_CODE) VOP++;
|
||||||
else if (temp_buffer == VISUAL_OBJECT_START_CODE) VISO++;
|
else if (temp_buffer == VISUAL_OBJECT_START_CODE) VISO++;
|
||||||
else if (temp_buffer < 0x120) VO++;
|
else if (temp_buffer >= 0x100 && temp_buffer < 0x120) VO++;
|
||||||
else if (temp_buffer < 0x130) VOL++;
|
else if (temp_buffer >= 0x120 && temp_buffer < 0x130) VOL++;
|
||||||
else if ( !(0x1AF < temp_buffer && temp_buffer < 0x1B7)
|
else if ( !(0x1AF < temp_buffer && temp_buffer < 0x1B7)
|
||||||
&& !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++;
|
&& !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++;
|
||||||
}
|
}
|
||||||
|
@@ -1362,13 +1362,17 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)
|
|||||||
EbmlList *seekhead_list = &matroska->seekhead;
|
EbmlList *seekhead_list = &matroska->seekhead;
|
||||||
int64_t before_pos = avio_tell(matroska->ctx->pb);
|
int64_t before_pos = avio_tell(matroska->ctx->pb);
|
||||||
int i;
|
int i;
|
||||||
|
int nb_elem;
|
||||||
|
|
||||||
// we should not do any seeking in the streaming case
|
// we should not do any seeking in the streaming case
|
||||||
if (!matroska->ctx->pb->seekable ||
|
if (!matroska->ctx->pb->seekable ||
|
||||||
(matroska->ctx->flags & AVFMT_FLAG_IGNIDX))
|
(matroska->ctx->flags & AVFMT_FLAG_IGNIDX))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < seekhead_list->nb_elem; i++) {
|
// do not read entries that are added while parsing seekhead entries
|
||||||
|
nb_elem = seekhead_list->nb_elem;
|
||||||
|
|
||||||
|
for (i = 0; i < nb_elem; i++) {
|
||||||
MatroskaSeekhead *seekhead = seekhead_list->elem;
|
MatroskaSeekhead *seekhead = seekhead_list->elem;
|
||||||
if (seekhead[i].pos <= before_pos)
|
if (seekhead[i].pos <= before_pos)
|
||||||
continue;
|
continue;
|
||||||
@@ -1785,7 +1789,8 @@ static int matroska_read_header(AVFormatContext *s)
|
|||||||
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
|
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
|
||||||
1000000000, track->default_duration, 30000);
|
1000000000, track->default_duration, 30000);
|
||||||
#if FF_API_R_FRAME_RATE
|
#if FF_API_R_FRAME_RATE
|
||||||
if (st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L)
|
if ( st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L
|
||||||
|
&& st->avg_frame_rate.num > st->avg_frame_rate.den * 5L)
|
||||||
st->r_frame_rate = st->avg_frame_rate;
|
st->r_frame_rate = st->avg_frame_rate;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -2788,6 +2788,12 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
MOVAtom a;
|
MOVAtom a;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (c->atom_depth > 10) {
|
||||||
|
av_log(c->fc, AV_LOG_ERROR, "Atoms too deeply nested\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
c->atom_depth ++;
|
||||||
|
|
||||||
if (atom.size < 0)
|
if (atom.size < 0)
|
||||||
atom.size = INT64_MAX;
|
atom.size = INT64_MAX;
|
||||||
while (total_size + 8 <= atom.size && !url_feof(pb)) {
|
while (total_size + 8 <= atom.size && !url_feof(pb)) {
|
||||||
@@ -2804,6 +2810,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
{
|
{
|
||||||
av_log(c->fc, AV_LOG_ERROR, "Broken file, trak/mdat not at top-level\n");
|
av_log(c->fc, AV_LOG_ERROR, "Broken file, trak/mdat not at top-level\n");
|
||||||
avio_skip(pb, -8);
|
avio_skip(pb, -8);
|
||||||
|
c->atom_depth --;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2840,13 +2847,16 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
int64_t start_pos = avio_tell(pb);
|
int64_t start_pos = avio_tell(pb);
|
||||||
int64_t left;
|
int64_t left;
|
||||||
int err = parse(c, pb, a);
|
int err = parse(c, pb, a);
|
||||||
if (err < 0)
|
if (err < 0) {
|
||||||
|
c->atom_depth --;
|
||||||
return err;
|
return err;
|
||||||
|
}
|
||||||
if (c->found_moov && c->found_mdat &&
|
if (c->found_moov && c->found_mdat &&
|
||||||
((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) ||
|
((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) ||
|
||||||
start_pos + a.size == avio_size(pb))) {
|
start_pos + a.size == avio_size(pb))) {
|
||||||
if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX)
|
if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX)
|
||||||
c->next_root_atom = start_pos + a.size;
|
c->next_root_atom = start_pos + a.size;
|
||||||
|
c->atom_depth --;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
left = a.size - avio_tell(pb) + start_pos;
|
left = a.size - avio_tell(pb) + start_pos;
|
||||||
@@ -2864,6 +2874,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
if (total_size < atom.size && atom.size < 0x7ffff)
|
if (total_size < atom.size && atom.size < 0x7ffff)
|
||||||
avio_skip(pb, atom.size - total_size);
|
avio_skip(pb, atom.size - total_size);
|
||||||
|
|
||||||
|
c->atom_depth --;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -91,7 +91,7 @@ static int mpegps_probe(AVProbeData *p)
|
|||||||
score= AVPROBE_SCORE_MAX/4;
|
score= AVPROBE_SCORE_MAX/4;
|
||||||
|
|
||||||
if(sys>invalid && sys*9 <= pspack*10)
|
if(sys>invalid && sys*9 <= pspack*10)
|
||||||
return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg
|
return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4+1; // +1 for .mpg
|
||||||
if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9)
|
if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9)
|
||||||
return pspack > 2 ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg
|
return pspack > 2 ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg
|
||||||
if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048 && vid + audio > invalid) /* PES stream */
|
if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048 && vid + audio > invalid) /* PES stream */
|
||||||
|
@@ -1695,7 +1695,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
|
|||||||
break;
|
break;
|
||||||
desc_len = get8(&p, desc_list_end);
|
desc_len = get8(&p, desc_list_end);
|
||||||
desc_end = p + desc_len;
|
desc_end = p + desc_len;
|
||||||
if (desc_end > desc_list_end)
|
if (desc_len < 0 || desc_end > desc_list_end)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
av_dlog(ts->stream, "tag: 0x%02x len=%d\n",
|
av_dlog(ts->stream, "tag: 0x%02x len=%d\n",
|
||||||
|
@@ -309,6 +309,9 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
|
|||||||
int64_t codec_pos;
|
int64_t codec_pos;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (codec_data_size < 0)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
avpriv_set_pts_info(st, 64, 1, 1000);
|
avpriv_set_pts_info(st, 64, 1, 1000);
|
||||||
codec_pos = avio_tell(pb);
|
codec_pos = avio_tell(pb);
|
||||||
v = avio_rb32(pb);
|
v = avio_rb32(pb);
|
||||||
|
@@ -283,6 +283,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
const int bmp_fmt = avio_r8(pb);
|
const int bmp_fmt = avio_r8(pb);
|
||||||
const int width = avio_rl16(pb);
|
const int width = avio_rl16(pb);
|
||||||
const int height = avio_rl16(pb);
|
const int height = avio_rl16(pb);
|
||||||
|
int pix_fmt;
|
||||||
|
|
||||||
len -= 2+1+2+2;
|
len -= 2+1+2+2;
|
||||||
|
|
||||||
@@ -347,17 +348,21 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
avpriv_set_pts_info(vst, 64, 256, swf->frame_rate);
|
avpriv_set_pts_info(vst, 64, 256, swf->frame_rate);
|
||||||
st = vst;
|
st = vst;
|
||||||
}
|
}
|
||||||
st->codec->width = width;
|
|
||||||
st->codec->height = height;
|
|
||||||
|
|
||||||
if ((res = av_new_packet(pkt, out_len - colormapsize * colormapbpp)) < 0)
|
if ((res = av_new_packet(pkt, out_len - colormapsize * colormapbpp)) < 0)
|
||||||
goto bitmap_end;
|
goto bitmap_end;
|
||||||
|
if (!st->codec->width && !st->codec->height) {
|
||||||
|
st->codec->width = width;
|
||||||
|
st->codec->height = height;
|
||||||
|
} else {
|
||||||
|
ff_add_param_change(pkt, 0, 0, 0, width, height);
|
||||||
|
}
|
||||||
pkt->pos = pos;
|
pkt->pos = pos;
|
||||||
pkt->stream_index = st->index;
|
pkt->stream_index = st->index;
|
||||||
|
|
||||||
switch (bmp_fmt) {
|
switch (bmp_fmt) {
|
||||||
case 3:
|
case 3:
|
||||||
st->codec->pix_fmt = AV_PIX_FMT_PAL8;
|
pix_fmt = AV_PIX_FMT_PAL8;
|
||||||
for (i = 0; i < colormapsize; i++)
|
for (i = 0; i < colormapsize; i++)
|
||||||
if (alpha_bmp) colormap[i] = buf[3]<<24 | AV_RB24(buf + 4*i);
|
if (alpha_bmp) colormap[i] = buf[3]<<24 | AV_RB24(buf + 4*i);
|
||||||
else colormap[i] = 0xffU <<24 | AV_RB24(buf + 3*i);
|
else colormap[i] = 0xffU <<24 | AV_RB24(buf + 3*i);
|
||||||
@@ -369,14 +374,20 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
memcpy(pal, colormap, AVPALETTE_SIZE);
|
memcpy(pal, colormap, AVPALETTE_SIZE);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
st->codec->pix_fmt = AV_PIX_FMT_RGB555;
|
pix_fmt = AV_PIX_FMT_RGB555;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
st->codec->pix_fmt = alpha_bmp ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB;
|
pix_fmt = alpha_bmp ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
av_assert0(0);
|
av_assert0(0);
|
||||||
}
|
}
|
||||||
|
if (st->codec->pix_fmt != AV_PIX_FMT_NONE && st->codec->pix_fmt != pix_fmt) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "pixel format change unsupported\n");
|
||||||
|
res = AVERROR_PATCHWELCOME;
|
||||||
|
goto bitmap_end;
|
||||||
|
}
|
||||||
|
st->codec->pix_fmt = pix_fmt;
|
||||||
|
|
||||||
if (linesize * height > pkt->size) {
|
if (linesize * height > pkt->size) {
|
||||||
res = AVERROR_INVALIDDATA;
|
res = AVERROR_INVALIDDATA;
|
||||||
|
@@ -251,7 +251,7 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
|
|||||||
if ((ret = av_copy_packet(&pkt2, pkt)) < 0 ||
|
if ((ret = av_copy_packet(&pkt2, pkt)) < 0 ||
|
||||||
(ret = av_dup_packet(&pkt2))< 0)
|
(ret = av_dup_packet(&pkt2))< 0)
|
||||||
if (!ret_all) {
|
if (!ret_all) {
|
||||||
ret = ret_all;
|
ret_all = ret;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
tb = avf ->streams[s]->time_base;
|
tb = avf ->streams[s]->time_base;
|
||||||
|
@@ -1533,7 +1533,8 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* read packet from packet buffer, if there is data */
|
/* read packet from packet buffer, if there is data */
|
||||||
if (!(next_pkt->pts == AV_NOPTS_VALUE &&
|
st = s->streams[next_pkt->stream_index];
|
||||||
|
if (!(next_pkt->pts == AV_NOPTS_VALUE && st->discard < AVDISCARD_ALL &&
|
||||||
next_pkt->dts != AV_NOPTS_VALUE && !eof)) {
|
next_pkt->dts != AV_NOPTS_VALUE && !eof)) {
|
||||||
ret = read_from_packet_buffer(&s->packet_buffer,
|
ret = read_from_packet_buffer(&s->packet_buffer,
|
||||||
&s->packet_buffer_end, pkt);
|
&s->packet_buffer_end, pkt);
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
"cpuid \n\t" \
|
"cpuid \n\t" \
|
||||||
"xchg %%"REG_b", %%"REG_S \
|
"xchg %%"REG_b", %%"REG_S \
|
||||||
: "=a" (eax), "=S" (ebx), "=c" (ecx), "=d" (edx) \
|
: "=a" (eax), "=S" (ebx), "=c" (ecx), "=d" (edx) \
|
||||||
: "0" (index))
|
: "0" (index), "2"(0))
|
||||||
|
|
||||||
#define xgetbv(index, eax, edx) \
|
#define xgetbv(index, eax, edx) \
|
||||||
__asm__ (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index))
|
__asm__ (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index))
|
||||||
|
@@ -975,7 +975,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3],
|
|||||||
|
|
||||||
if(pict_type & PP_PICT_TYPE_QP2){
|
if(pict_type & PP_PICT_TYPE_QP2){
|
||||||
int i;
|
int i;
|
||||||
const int count= mbHeight * absQPStride;
|
const int count= FFMAX(mbHeight * absQPStride, mbWidth);
|
||||||
for(i=0; i<(count>>2); i++){
|
for(i=0; i<(count>>2); i++){
|
||||||
((uint32_t*)c->stdQPTable)[i] = (((const uint32_t*)QP_store)[i]>>1) & 0x7F7F7F7F;
|
((uint32_t*)c->stdQPTable)[i] = (((const uint32_t*)QP_store)[i]>>1) & 0x7F7F7F7F;
|
||||||
}
|
}
|
||||||
@@ -1000,7 +1000,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3],
|
|||||||
if((pict_type&7)!=3){
|
if((pict_type&7)!=3){
|
||||||
if (QPStride >= 0){
|
if (QPStride >= 0){
|
||||||
int i;
|
int i;
|
||||||
const int count= mbHeight * QPStride;
|
const int count= FFMAX(mbHeight * QPStride, mbWidth);
|
||||||
for(i=0; i<(count>>2); i++){
|
for(i=0; i<(count>>2); i++){
|
||||||
((uint32_t*)c->nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] & 0x3F3F3F3F;
|
((uint32_t*)c->nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] & 0x3F3F3F3F;
|
||||||
}
|
}
|
||||||
|
@@ -76,8 +76,12 @@ static int process(
|
|||||||
AudioData *src, int src_size, int *consumed){
|
AudioData *src, int src_size, int *consumed){
|
||||||
size_t idone, odone;
|
size_t idone, odone;
|
||||||
soxr_error_t error = soxr_set_error((soxr_t)c, soxr_set_num_channels((soxr_t)c, src->ch_count));
|
soxr_error_t error = soxr_set_error((soxr_t)c, soxr_set_num_channels((soxr_t)c, src->ch_count));
|
||||||
|
if (!error)
|
||||||
error = soxr_process((soxr_t)c, src->ch, (size_t)src_size,
|
error = soxr_process((soxr_t)c, src->ch, (size_t)src_size,
|
||||||
&idone, dst->ch, (size_t)dst_size, &odone);
|
&idone, dst->ch, (size_t)dst_size, &odone);
|
||||||
|
else
|
||||||
|
idone = 0;
|
||||||
|
|
||||||
*consumed = (int)idone;
|
*consumed = (int)idone;
|
||||||
return error? -1 : odone;
|
return error? -1 : odone;
|
||||||
}
|
}
|
||||||
|
@@ -751,6 +751,8 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun
|
|||||||
in_count = 0;
|
in_count = 0;
|
||||||
if(ret>0) {
|
if(ret>0) {
|
||||||
s->drop_output -= ret;
|
s->drop_output -= ret;
|
||||||
|
if (!s->drop_output && !out_arg)
|
||||||
|
return 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
|
#define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
|
||||||
|
|
||||||
#define YUVRGB_TABLE_HEADROOM 128
|
#define YUVRGB_TABLE_HEADROOM 256
|
||||||
|
|
||||||
#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
|
#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
|
||||||
|
|
||||||
|
@@ -1616,6 +1616,16 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
|
|||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
const x86_reg chromWidth= width>>1;
|
const x86_reg chromWidth= width>>1;
|
||||||
|
|
||||||
|
if (height > 2) {
|
||||||
|
rgb24toyv12_c(src, ydst, udst, vdst, width, 2, lumStride, chromStride, srcStride);
|
||||||
|
src += 2*srcStride;
|
||||||
|
ydst += 2*lumStride;
|
||||||
|
udst += chromStride;
|
||||||
|
vdst += chromStride;
|
||||||
|
height -= 2;
|
||||||
|
}
|
||||||
|
|
||||||
for (y=0; y<height-2; y+=2) {
|
for (y=0; y<height-2; y+=2) {
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<2; i++) {
|
for (i=0; i<2; i++) {
|
||||||
@@ -1864,6 +1874,7 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui
|
|||||||
for (h=0; h < height; h++) {
|
for (h=0; h < height; h++) {
|
||||||
int w;
|
int w;
|
||||||
|
|
||||||
|
if (width >= 16)
|
||||||
#if COMPILE_TEMPLATE_SSE2
|
#if COMPILE_TEMPLATE_SSE2
|
||||||
__asm__(
|
__asm__(
|
||||||
"xor %%"REG_a", %%"REG_a" \n\t"
|
"xor %%"REG_a", %%"REG_a" \n\t"
|
||||||
|
@@ -1 +1 @@
|
|||||||
pp3 39af1a30d0ea0e906df264773adfcaa6
|
pp3 c8277ef31ab01bad51356841c9634522
|
||||||
|
@@ -2,7 +2,11 @@
|
|||||||
|
|
||||||
# check for git short hash
|
# check for git short hash
|
||||||
if ! test "$revision"; then
|
if ! test "$revision"; then
|
||||||
|
if (cd "$1" && grep git RELEASE 2> /dev/null >/dev/null) ; then
|
||||||
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
|
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
|
||||||
|
else
|
||||||
|
revision=$(cd "$1" && git describe --tags --always 2> /dev/null)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Shallow Git clones (--depth) do not have the N tag:
|
# Shallow Git clones (--depth) do not have the N tag:
|
||||||
|
Reference in New Issue
Block a user