Compare commits
135 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 36cfee3adc | |||
| 2dca276dcb | |||
| 0ee5f46fd1 | |||
| b1b69baa01 | |||
| f0526bc21e | |||
| 0afe061f28 | |||
| e6093f5b85 | |||
| 8323f09442 | |||
| 68d83bc3a6 | |||
| 0c9d465e98 | |||
| a3dca10470 | |||
| eca1e3dcc8 | |||
| 7c3a3d47cf | |||
| bd9c755b22 | |||
| 4c246c65bf | |||
| b0d3873085 | |||
| b902eab45a | |||
| 79d86b844f | |||
| 3d8c51d699 | |||
| c7dc73a6c3 | |||
| 4f2299b6b5 | |||
| 004cdd8b15 | |||
| cd5c78c804 | |||
| ab17d11310 | |||
| d0ed336d8a | |||
| 56e07e4caf | |||
| e61a7c9b45 | |||
| 56976346d9 | |||
| e5b878b37f | |||
| d5b20daeb0 | |||
| a9602c6cfb | |||
| 86a01362c0 | |||
| 9789612689 | |||
| 3769601fb6 | |||
| 2528468e20 | |||
| f1d59a207f | |||
| 85b2396265 | |||
| 25dc978bb1 | |||
| 13838647ca | |||
| 133dc77da9 | |||
| 9ce4686bfe | |||
| 50e04b3f3c | |||
| 226727f08f | |||
| b8021620e2 | |||
| a0f4f12b62 | |||
| c351cd720a | |||
| 7279be7c75 | |||
| f5fd937fc5 | |||
| de43442391 | |||
| 3b9cb8d7d8 | |||
| b9510b3274 | |||
| 30099bf0f0 | |||
| f2fde86dae | |||
| a40e6a214e | |||
| 3e8b73e65b | |||
| 8babbdc9b1 | |||
| e91df69cf2 | |||
| 855ae45c5a | |||
| b1959b1719 | |||
| ecae610207 | |||
| 33a67961c8 | |||
| fc1fed62d9 | |||
| 0684cd5d8c | |||
| a4a87a7efd | |||
| b76dc8b5b8 | |||
| 6e2204b152 | |||
| 81bdaacb65 | |||
| 3e3193f03c | |||
| 3b17c1e13e | |||
| 8abe459ac6 | |||
| bebe3d35f3 | |||
| 7c270a5e3b | |||
| 20a03d5c93 | |||
| 57710c3646 | |||
| 0d481efb7b | |||
| 92a36a4e78 | |||
| ef33242c2a | |||
| 1c983ee2c1 | |||
| a6d59978a0 | |||
| e9ddf726aa | |||
| c52c9f534e | |||
| 0d31a01d3a | |||
| 475d68e0f5 | |||
| 7fd20799d7 | |||
| bf00132a14 | |||
| ede5946b70 | |||
| 3cd2c33d36 | |||
| c494be6411 | |||
| 2d855c94b6 | |||
| f249e98891 | |||
| 92888e9ed4 | |||
| 3f10a779b4 | |||
| 8f238dd9bd | |||
| da4f5d9d77 | |||
| 931f5b2351 | |||
| b807e987f1 | |||
| e7fdd6aa0d | |||
| 9f09bfe681 | |||
| 7390c2629d | |||
| 3d9860f68a | |||
| 4fde30ba9d | |||
| a06432b6c3 | |||
| d7470271c7 | |||
| d41010b895 | |||
| a63941eec2 | |||
| 5d6f8bab02 | |||
| de7671e4c4 | |||
| 217f781adc | |||
| 9440079216 | |||
| d054ec868d | |||
| 4d8b82160d | |||
| 84fdfcab99 | |||
| cd01611d7b | |||
| 8b8d794800 | |||
| 9a02be3122 | |||
| 223ae2467e | |||
| 9e65065080 | |||
| 5111c78eab | |||
| 394d3c937a | |||
| afcd152b97 | |||
| dad7beaceb | |||
| 93360af0d7 | |||
| 4ed83378bf | |||
| 1579f14632 | |||
| 7394e53f30 | |||
| 9bbed55b10 | |||
| 9181faab68 | |||
| d1c2f86b21 | |||
| 2bcd8f22f2 | |||
| c790e31ae4 | |||
| 7fe5d0a78d | |||
| bf219a564c | |||
| 871d99ef77 | |||
| 418e9a6113 | |||
| e25e0903ab |
@@ -0,0 +1 @@
|
||||
*.pnm -diff -text
|
||||
@@ -106,7 +106,7 @@ endef
|
||||
|
||||
$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
|
||||
|
||||
ffprobe.o cmdutils.o : libavutil/ffversion.h
|
||||
ffprobe.o cmdutils.o libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
|
||||
|
||||
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
|
||||
$(CP) $< $@
|
||||
|
||||
+1
-1
@@ -1803,7 +1803,7 @@ int read_yesno(void)
|
||||
|
||||
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
||||
{
|
||||
int ret;
|
||||
int64_t ret;
|
||||
FILE *f = av_fopen_utf8(filename, "rb");
|
||||
|
||||
if (!f) {
|
||||
|
||||
@@ -5176,7 +5176,7 @@ cat > $TMPH <<EOF
|
||||
#define FFMPEG_CONFIG_H
|
||||
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
|
||||
#define FFMPEG_LICENSE "$(c_escape $license)"
|
||||
#define CONFIG_THIS_YEAR 2014
|
||||
#define CONFIG_THIS_YEAR 2015
|
||||
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
|
||||
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
|
||||
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
|
||||
@@ -5203,6 +5203,7 @@ enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
|
||||
|
||||
|
||||
mkdir -p doc
|
||||
mkdir -p tests
|
||||
echo "@c auto-generated by configure" > doc/config.texi
|
||||
|
||||
print_config ARCH_ "$config_files" $ARCH_LIST
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 2.2.10
|
||||
PROJECT_NUMBER = 2.2.13
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
||||
@@ -2284,7 +2284,7 @@ static int transcode_init(void)
|
||||
AVCodecContext *codec;
|
||||
OutputStream *ost;
|
||||
InputStream *ist;
|
||||
char error[1024];
|
||||
char error[1024] = {0};
|
||||
int want_sdp = 1;
|
||||
|
||||
for (i = 0; i < nb_filtergraphs; i++) {
|
||||
|
||||
@@ -78,6 +78,7 @@ av_cold void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
|
||||
c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
|
||||
c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
|
||||
c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
|
||||
if (chroma_format_idc <= 1)
|
||||
c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
|
||||
|
||||
c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
|
||||
|
||||
@@ -23,9 +23,10 @@
|
||||
#include "libavutil/arm/asm.S"
|
||||
|
||||
function ff_prefetch_arm, export=1
|
||||
1:
|
||||
subs r2, r2, #1
|
||||
pld [r0]
|
||||
add r0, r0, r1
|
||||
bne X(ff_prefetch_arm)
|
||||
bne 1b
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
@@ -2349,6 +2349,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#else
|
||||
if (s->xch_present && !s->xch_disable) {
|
||||
#endif
|
||||
if (avctx->channel_layout & AV_CH_BACK_CENTER) {
|
||||
avpriv_request_sample(avctx, "XCh with Back center channel");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
avctx->channel_layout |= AV_CH_BACK_CENTER;
|
||||
if (s->lfe) {
|
||||
avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
|
||||
|
||||
+15
-13
@@ -37,7 +37,7 @@ typedef struct DVDSubContext
|
||||
int has_palette;
|
||||
uint8_t colormap[4];
|
||||
uint8_t alpha[256];
|
||||
uint8_t *buf;
|
||||
uint8_t buf[0x10000];
|
||||
int buf_size;
|
||||
#ifdef DEBUG
|
||||
int sub_id;
|
||||
@@ -105,6 +105,12 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
|
||||
int x, y, len, color;
|
||||
uint8_t *d;
|
||||
|
||||
if (start >= buf_size)
|
||||
return -1;
|
||||
|
||||
if (w <= 0 || h <= 0)
|
||||
return -1;
|
||||
|
||||
bit_len = (buf_size - start) * 8;
|
||||
init_get_bits(&gb, buf + start, bit_len);
|
||||
|
||||
@@ -356,10 +362,12 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
||||
sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
|
||||
sub_header->num_rects = 1;
|
||||
sub_header->rects[0]->pict.data[0] = bitmap;
|
||||
decode_rle(bitmap, w * 2, w, (h + 1) / 2,
|
||||
buf, offset1, buf_size, is_8bit);
|
||||
decode_rle(bitmap + w, w * 2, w, h / 2,
|
||||
buf, offset2, buf_size, is_8bit);
|
||||
if (decode_rle(bitmap, w * 2, w, (h + 1) / 2,
|
||||
buf, offset1, buf_size, is_8bit) < 0)
|
||||
goto fail;
|
||||
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);
|
||||
if (is_8bit) {
|
||||
if (yuv_palette == 0)
|
||||
@@ -494,15 +502,11 @@ static int append_to_cached_buf(AVCodecContext *avctx,
|
||||
{
|
||||
DVDSubContext *ctx = avctx->priv_data;
|
||||
|
||||
if (ctx->buf_size > 0xffff - buf_size) {
|
||||
if (ctx->buf_size >= sizeof(ctx->buf) - buf_size) {
|
||||
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
|
||||
"too large SPU packets aborted.\n");
|
||||
av_freep(&ctx->buf);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
ctx->buf = av_realloc(ctx->buf, ctx->buf_size + buf_size);
|
||||
if (!ctx->buf)
|
||||
return AVERROR(ENOMEM);
|
||||
memcpy(ctx->buf + ctx->buf_size, buf, buf_size);
|
||||
ctx->buf_size += buf_size;
|
||||
return 0;
|
||||
@@ -518,7 +522,7 @@ static int dvdsub_decode(AVCodecContext *avctx,
|
||||
AVSubtitle *sub = data;
|
||||
int is_menu;
|
||||
|
||||
if (ctx->buf) {
|
||||
if (ctx->buf_size) {
|
||||
int ret = append_to_cached_buf(avctx, buf, buf_size);
|
||||
if (ret < 0) {
|
||||
*data_size = 0;
|
||||
@@ -556,7 +560,6 @@ static int dvdsub_decode(AVCodecContext *avctx,
|
||||
}
|
||||
#endif
|
||||
|
||||
av_freep(&ctx->buf);
|
||||
ctx->buf_size = 0;
|
||||
*data_size = 1;
|
||||
return buf_size;
|
||||
@@ -638,7 +641,6 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
|
||||
static av_cold int dvdsub_close(AVCodecContext *avctx)
|
||||
{
|
||||
DVDSubContext *ctx = avctx->priv_data;
|
||||
av_freep(&ctx->buf);
|
||||
ctx->buf_size = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
+3
-3
@@ -63,7 +63,7 @@ static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,
|
||||
uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
|
||||
int ret;
|
||||
|
||||
if (src_size < avctx->width * avctx->height * 9L / 8) {
|
||||
if (src_size < avctx->width * avctx->height * 9LL / 8) {
|
||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
|
||||
uint8_t *Y1, *Y2, *U, *V;
|
||||
int ret;
|
||||
|
||||
if (src_size < avctx->width * avctx->height * 3L / 2) {
|
||||
if (src_size < avctx->width * avctx->height * 3LL / 2) {
|
||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ static int dxtory_decode_v1_444(AVCodecContext *avctx, AVFrame *pic,
|
||||
uint8_t *Y, *U, *V;
|
||||
int ret;
|
||||
|
||||
if (src_size < avctx->width * avctx->height * 3L) {
|
||||
if (src_size < avctx->width * avctx->height * 3LL) {
|
||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
handle_error:
|
||||
*poutbuf = NULL;
|
||||
*poutbuf_size = 0;
|
||||
return read_end - buf;
|
||||
return buf_size ? read_end - buf : 0;
|
||||
}
|
||||
|
||||
static av_cold int flac_parse_init(AVCodecParserContext *c)
|
||||
|
||||
@@ -471,10 +471,10 @@ static int decode_frame(FLACContext *s)
|
||||
ret = allocate_buffers(s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
|
||||
s->got_streaminfo = 1;
|
||||
dump_headers(s->avctx, (FLACStreaminfo *)s);
|
||||
}
|
||||
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
|
||||
|
||||
// dump_headers(s->avctx, (FLACStreaminfo *)s);
|
||||
|
||||
|
||||
+2
-2
@@ -105,7 +105,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
|
||||
/* skip common columns */
|
||||
while (x_start < x_end) {
|
||||
int same_column = 1;
|
||||
for (y = y_start; y < y_end; y++) {
|
||||
for (y = y_start; y <= y_end; y++) {
|
||||
if (ref[y*ref_linesize + x_start] != buf[y*linesize + x_start]) {
|
||||
same_column = 0;
|
||||
break;
|
||||
@@ -117,7 +117,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
|
||||
}
|
||||
while (x_end > x_start) {
|
||||
int same_column = 1;
|
||||
for (y = y_start; y < y_end; y++) {
|
||||
for (y = y_start; y <= y_end; y++) {
|
||||
if (ref[y*ref_linesize + x_end] != buf[y*linesize + x_end]) {
|
||||
same_column = 0;
|
||||
break;
|
||||
|
||||
+1
-1
@@ -269,7 +269,7 @@ static int gif_read_image(GifState *s, AVFrame *frame)
|
||||
break;
|
||||
}
|
||||
while (y1 >= height) {
|
||||
y1 = 4 >> pass;
|
||||
y1 = 4 >> pass;
|
||||
ptr = ptr1 + linesize * y1;
|
||||
pass++;
|
||||
}
|
||||
|
||||
+68
-21
@@ -1233,6 +1233,7 @@ static void free_tables(H264Context *h, int free_rbsp)
|
||||
av_buffer_pool_uninit(&h->ref_index_pool);
|
||||
|
||||
if (free_rbsp && h->DPB) {
|
||||
memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
|
||||
for (i = 0; i < MAX_PICTURE_COUNT; i++)
|
||||
unref_picture(h, &h->DPB[i]);
|
||||
av_freep(&h->DPB);
|
||||
@@ -1821,6 +1822,17 @@ static int decode_update_thread_context(AVCodecContext *dst,
|
||||
h->mb_type_pool = NULL;
|
||||
h->ref_index_pool = NULL;
|
||||
h->motion_val_pool = 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;
|
||||
for (i = 0; i < 2; i++) {
|
||||
h->rbsp_buffer[i] = NULL;
|
||||
h->rbsp_buffer_size[i] = 0;
|
||||
@@ -2695,6 +2707,16 @@ int ff_pred_weight_table(H264Context *h)
|
||||
h->luma_log2_weight_denom = get_ue_golomb(&h->gb);
|
||||
if (h->sps.chroma_format_idc)
|
||||
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;
|
||||
chroma_def = 1 << h->chroma_log2_weight_denom;
|
||||
|
||||
@@ -3484,6 +3506,9 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
int must_reinit;
|
||||
int needs_reinit = 0;
|
||||
int field_pic_flag, bottom_field_flag;
|
||||
int first_slice = h == h0 && !h0->current_slice;
|
||||
int frame_num, picture_structure, droppable;
|
||||
PPS *pps;
|
||||
|
||||
h->me.qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
|
||||
h->me.qpel_avg = h->h264qpel.avg_h264_qpel_pixels_tab;
|
||||
@@ -3548,18 +3573,27 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
h0->au_pps_id, pps_id);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
h->pps = *h0->pps_buffers[pps_id];
|
||||
|
||||
if (!h0->sps_buffers[h->pps.sps_id]) {
|
||||
pps = h0->pps_buffers[pps_id];
|
||||
|
||||
if (!h0->sps_buffers[pps->sps_id]) {
|
||||
av_log(h->avctx, AV_LOG_ERROR,
|
||||
"non-existing SPS %u referenced\n",
|
||||
h->pps.sps_id);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (first_slice)
|
||||
h->pps = *h0->pps_buffers[pps_id];
|
||||
|
||||
if (h->pps.sps_id != h->sps.sps_id ||
|
||||
h->pps.sps_id != h->current_sps_id ||
|
||||
h0->sps_buffers[h->pps.sps_id]->new) {
|
||||
if (pps->sps_id != h->sps.sps_id ||
|
||||
pps->sps_id != h->current_sps_id ||
|
||||
h0->sps_buffers[pps->sps_id]->new) {
|
||||
|
||||
if (!first_slice) {
|
||||
av_log(h->avctx, AV_LOG_ERROR,
|
||||
"SPS changed in the middle of the frame\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
h->sps = *h0->sps_buffers[h->pps.sps_id];
|
||||
|
||||
@@ -3589,13 +3623,15 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
|| 16*h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) != h->avctx->coded_height
|
||||
|| h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma
|
||||
|| h->cur_chroma_format_idc != h->sps.chroma_format_idc
|
||||
|| av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio)
|
||||
|| h->mb_width != h->sps.mb_width
|
||||
|| h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
|
||||
));
|
||||
if (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0)))
|
||||
must_reinit = 1;
|
||||
|
||||
if (first_slice && av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio))
|
||||
must_reinit = 1;
|
||||
|
||||
h->mb_width = h->sps.mb_width;
|
||||
h->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
|
||||
h->mb_num = h->mb_width * h->mb_height;
|
||||
@@ -3677,39 +3713,43 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
init_dequant_tables(h);
|
||||
}
|
||||
|
||||
h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
|
||||
frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
|
||||
if (!first_slice) {
|
||||
if (h0->frame_num != frame_num) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "Frame num change from %d to %d\n",
|
||||
h0->frame_num, frame_num);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
h->mb_mbaff = 0;
|
||||
h->mb_aff_frame = 0;
|
||||
last_pic_structure = h0->picture_structure;
|
||||
last_pic_droppable = h0->droppable;
|
||||
h->droppable = h->nal_ref_idc == 0;
|
||||
droppable = h->nal_ref_idc == 0;
|
||||
if (h->sps.frame_mbs_only_flag) {
|
||||
h->picture_structure = PICT_FRAME;
|
||||
picture_structure = PICT_FRAME;
|
||||
} else {
|
||||
if (!h->sps.direct_8x8_inference_flag && slice_type == AV_PICTURE_TYPE_B) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n");
|
||||
return -1;
|
||||
}
|
||||
field_pic_flag = get_bits1(&h->gb);
|
||||
|
||||
if (field_pic_flag) {
|
||||
bottom_field_flag = get_bits1(&h->gb);
|
||||
h->picture_structure = PICT_TOP_FIELD + bottom_field_flag;
|
||||
picture_structure = PICT_TOP_FIELD + bottom_field_flag;
|
||||
} else {
|
||||
h->picture_structure = PICT_FRAME;
|
||||
picture_structure = PICT_FRAME;
|
||||
h->mb_aff_frame = h->sps.mb_aff;
|
||||
}
|
||||
}
|
||||
h->mb_field_decoding_flag = h->picture_structure != PICT_FRAME;
|
||||
|
||||
if (h0->current_slice != 0) {
|
||||
if (last_pic_structure != h->picture_structure ||
|
||||
last_pic_droppable != h->droppable) {
|
||||
if (h0->current_slice) {
|
||||
if (last_pic_structure != picture_structure ||
|
||||
last_pic_droppable != droppable) {
|
||||
av_log(h->avctx, AV_LOG_ERROR,
|
||||
"Changing field mode (%d -> %d) between slices is not allowed\n",
|
||||
last_pic_structure, h->picture_structure);
|
||||
h->picture_structure = last_pic_structure;
|
||||
h->droppable = last_pic_droppable;
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else if (!h0->cur_pic_ptr) {
|
||||
av_log(h->avctx, AV_LOG_ERROR,
|
||||
@@ -3717,7 +3757,14 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
h0->current_slice + 1);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
h->picture_structure = picture_structure;
|
||||
h->droppable = droppable;
|
||||
h->frame_num = frame_num;
|
||||
h->mb_field_decoding_flag = picture_structure != PICT_FRAME;
|
||||
|
||||
if (h0->current_slice == 0) {
|
||||
/* Shorten frame num gaps so we don't have to allocate reference
|
||||
* frames just to throw them away */
|
||||
if (h->frame_num != h->prev_frame_num) {
|
||||
@@ -4923,8 +4970,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
|
||||
continue;
|
||||
|
||||
again:
|
||||
if ( !(avctx->active_thread_type & FF_THREAD_FRAME)
|
||||
|| nals_needed >= nal_index)
|
||||
if ( (!(avctx->active_thread_type & FF_THREAD_FRAME) || nals_needed >= nal_index)
|
||||
&& !h->current_slice)
|
||||
h->au_pps_id = -1;
|
||||
/* Ignore per frame NAL unit type during extradata
|
||||
* parsing. Decoding slices is not possible in codec init
|
||||
|
||||
@@ -286,6 +286,7 @@ typedef struct MMCO {
|
||||
* H264Context
|
||||
*/
|
||||
typedef struct H264Context {
|
||||
AVClass *av_class;
|
||||
AVCodecContext *avctx;
|
||||
VideoDSPContext vdsp;
|
||||
H264DSPContext h264dsp;
|
||||
|
||||
@@ -1280,7 +1280,7 @@ void ff_h264_init_cabac_states(H264Context *h) {
|
||||
}
|
||||
|
||||
static int decode_cabac_field_decoding_flag(H264Context *h) {
|
||||
const long mbb_xy = h->mb_xy - 2L*h->mb_stride;
|
||||
const int mbb_xy = h->mb_xy - 2*h->mb_stride;
|
||||
|
||||
unsigned long ctx = 0;
|
||||
|
||||
|
||||
@@ -383,7 +383,8 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
|
||||
"Different chroma and luma bit depth");
|
||||
goto fail;
|
||||
}
|
||||
if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U) {
|
||||
if (sps->bit_depth_luma < 8 || sps->bit_depth_luma > 14 ||
|
||||
sps->bit_depth_chroma < 8 || sps->bit_depth_chroma > 14) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
|
||||
sps->bit_depth_luma, sps->bit_depth_chroma);
|
||||
goto fail;
|
||||
|
||||
+20
-7
@@ -112,7 +112,7 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps)
|
||||
if (!s->tab_ipm || !s->cbf_luma || !s->is_pcm)
|
||||
goto fail;
|
||||
|
||||
s->filter_slice_edges = av_malloc(ctb_count);
|
||||
s->filter_slice_edges = av_mallocz(ctb_count);
|
||||
s->tab_slice_address = av_malloc_array(pic_size_in_ctb,
|
||||
sizeof(*s->tab_slice_address));
|
||||
s->qp_y_tab = av_malloc_array(pic_size_in_ctb,
|
||||
@@ -2568,17 +2568,30 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
|
||||
|
||||
if (s->nals_allocated < s->nb_nals + 1) {
|
||||
int new_size = s->nals_allocated + 1;
|
||||
HEVCNAL *tmp = av_realloc_array(s->nals, new_size, sizeof(*tmp));
|
||||
void *tmp = av_realloc_array(s->nals, new_size, sizeof(*s->nals));
|
||||
ret = AVERROR(ENOMEM);
|
||||
if (!tmp) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
s->nals = tmp;
|
||||
memset(s->nals + s->nals_allocated, 0,
|
||||
(new_size - s->nals_allocated) * sizeof(*tmp));
|
||||
av_reallocp_array(&s->skipped_bytes_nal, new_size, sizeof(*s->skipped_bytes_nal));
|
||||
av_reallocp_array(&s->skipped_bytes_pos_size_nal, new_size, sizeof(*s->skipped_bytes_pos_size_nal));
|
||||
av_reallocp_array(&s->skipped_bytes_pos_nal, new_size, sizeof(*s->skipped_bytes_pos_nal));
|
||||
(new_size - s->nals_allocated) * sizeof(*s->nals));
|
||||
|
||||
tmp = av_realloc_array(s->skipped_bytes_nal, new_size, sizeof(*s->skipped_bytes_nal));
|
||||
if (!tmp)
|
||||
goto fail;
|
||||
s->skipped_bytes_nal = tmp;
|
||||
|
||||
tmp = av_realloc_array(s->skipped_bytes_pos_size_nal, new_size, sizeof(*s->skipped_bytes_pos_size_nal));
|
||||
if (!tmp)
|
||||
goto fail;
|
||||
s->skipped_bytes_pos_size_nal = tmp;
|
||||
|
||||
tmp = av_realloc_array(s->skipped_bytes_pos_nal, new_size, sizeof(*s->skipped_bytes_pos_nal));
|
||||
if (!tmp)
|
||||
goto fail;
|
||||
s->skipped_bytes_pos_nal = tmp;
|
||||
|
||||
s->skipped_bytes_pos_size_nal[s->nals_allocated] = 1024; // initial buffer size
|
||||
s->skipped_bytes_pos_nal[s->nals_allocated] = av_malloc_array(s->skipped_bytes_pos_size_nal[s->nals_allocated], sizeof(*s->skipped_bytes_pos));
|
||||
s->nals_allocated = new_size;
|
||||
|
||||
@@ -843,6 +843,11 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
|
||||
sps->long_term_ref_pics_present_flag = get_bits1(gb);
|
||||
if (sps->long_term_ref_pics_present_flag) {
|
||||
sps->num_long_term_ref_pics_sps = get_ue_golomb_long(gb);
|
||||
if (sps->num_long_term_ref_pics_sps > 31U) {
|
||||
av_log(0, AV_LOG_ERROR, "num_long_term_ref_pics_sps %d is out of range.\n",
|
||||
sps->num_long_term_ref_pics_sps);
|
||||
goto err;
|
||||
}
|
||||
for (i = 0; i < sps->num_long_term_ref_pics_sps; i++) {
|
||||
sps->lt_ref_pic_poc_lsb_sps[i] = get_bits(gb, sps->log2_max_poc_lsb);
|
||||
sps->used_by_curr_pic_lt_sps_flag[i] = get_bits1(gb);
|
||||
@@ -1067,6 +1072,14 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
|
||||
if (pps->cu_qp_delta_enabled_flag)
|
||||
pps->diff_cu_qp_delta_depth = get_ue_golomb_long(gb);
|
||||
|
||||
if (pps->diff_cu_qp_delta_depth < 0 ||
|
||||
pps->diff_cu_qp_delta_depth > sps->log2_diff_max_min_coding_block_size) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "diff_cu_qp_delta_depth %d is invalid\n",
|
||||
pps->diff_cu_qp_delta_depth);
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto err;
|
||||
}
|
||||
|
||||
pps->cb_qp_offset = get_se_golomb(gb);
|
||||
if (pps->cb_qp_offset < -12 || pps->cb_qp_offset > 12) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "pps_cb_qp_offset out of range: %d\n",
|
||||
|
||||
+5
-3
@@ -94,7 +94,7 @@ typedef struct Indeo3DecodeContext {
|
||||
|
||||
int16_t width, height;
|
||||
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
|
||||
uint8_t cb_offset; ///< needed for selecting VQ tables
|
||||
uint8_t buf_sel; ///< active frame buffer: 0 - primary, 1 -secondary
|
||||
@@ -899,7 +899,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
GetByteContext gb;
|
||||
const uint8_t *bs_hdr;
|
||||
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;
|
||||
int i, j;
|
||||
|
||||
@@ -981,7 +982,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
ctx->y_data_size = ends[0] - starts[0];
|
||||
ctx->v_data_size = ends[1] - starts[1];
|
||||
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(y_offset, v_offset, u_offset) < gb.buffer - bs_hdr + 16 ||
|
||||
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");
|
||||
|
||||
@@ -43,6 +43,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
JvContext *s = avctx->priv_data;
|
||||
|
||||
if (!avctx->width || !avctx->height ||
|
||||
(avctx->width & 7) || (avctx->height & 7)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid video dimensions: %dx%d\n",
|
||||
avctx->width, avctx->height);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
s->frame = av_frame_alloc();
|
||||
if (!s->frame)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
+46
-23
@@ -240,8 +240,8 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
|
||||
int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
{
|
||||
int len, nb_components, i, width, height, bits, pix_fmt_id, ret;
|
||||
int h_count[MAX_COMPONENTS];
|
||||
int v_count[MAX_COMPONENTS];
|
||||
int h_count[MAX_COMPONENTS] = { 0 };
|
||||
int v_count[MAX_COMPONENTS] = { 0 };
|
||||
|
||||
s->cur_scan = 0;
|
||||
s->upscale_h = s->upscale_v = 0;
|
||||
@@ -249,7 +249,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
/* XXX: verify len field validity */
|
||||
len = get_bits(&s->gb, 16);
|
||||
s->avctx->bits_per_raw_sample =
|
||||
bits = get_bits(&s->gb, 8);
|
||||
bits = get_bits(&s->gb, 8);
|
||||
|
||||
if (s->pegasus_rct)
|
||||
bits = 9;
|
||||
@@ -292,8 +292,6 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
s->nb_components = nb_components;
|
||||
s->h_max = 1;
|
||||
s->v_max = 1;
|
||||
memset(h_count, 0, sizeof(h_count));
|
||||
memset(v_count, 0, sizeof(v_count));
|
||||
for (i = 0; i < nb_components; i++) {
|
||||
/* component id */
|
||||
s->component_id[i] = get_bits(&s->gb, 8) - 1;
|
||||
@@ -328,10 +326,9 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
|
||||
|
||||
/* if different size, realloc/alloc picture */
|
||||
if ( width != s->width || height != s->height
|
||||
|| bits != s->bits
|
||||
|| memcmp(s->h_count, h_count, sizeof(h_count))
|
||||
|| memcmp(s->v_count, v_count, sizeof(v_count))) {
|
||||
if (width != s->width || height != s->height || bits != s->bits ||
|
||||
memcmp(s->h_count, h_count, sizeof(h_count)) ||
|
||||
memcmp(s->v_count, v_count, sizeof(v_count))) {
|
||||
|
||||
s->width = width;
|
||||
s->height = height;
|
||||
@@ -498,9 +495,12 @@ unk_pixfmt:
|
||||
}
|
||||
if (s->ls) {
|
||||
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;
|
||||
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;
|
||||
else
|
||||
s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
|
||||
@@ -1183,13 +1183,18 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
|
||||
|
||||
if (s->interlaced && s->bottom_field)
|
||||
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 (copy_mb)
|
||||
mjpeg_copy_block(s, ptr, reference_data[c] + block_offset,
|
||||
linesize[c], s->avctx->lowres);
|
||||
if (copy_mb) {
|
||||
if (ptr)
|
||||
mjpeg_copy_block(s, ptr, reference_data[c] + block_offset,
|
||||
linesize[c], s->avctx->lowres);
|
||||
|
||||
else {
|
||||
} else {
|
||||
s->dsp.clear_block(s->block);
|
||||
if (decode_block(s, s->block, i,
|
||||
s->dc_index[i], s->ac_index[i],
|
||||
@@ -1198,9 +1203,11 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
|
||||
"error y=%d x=%d\n", mb_y, mb_x);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
s->dsp.idct_put(ptr, linesize[c], s->block);
|
||||
if (s->bits & 7)
|
||||
shift_output(s, ptr, linesize[c]);
|
||||
if (ptr) {
|
||||
s->dsp.idct_put(ptr, linesize[c], s->block);
|
||||
if (s->bits & 7)
|
||||
shift_output(s, ptr, linesize[c]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int block_idx = s->block_stride[c] * (v * mb_y + y) +
|
||||
@@ -1553,6 +1560,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
|
||||
}
|
||||
|
||||
if (id == AV_RB32("LJIF")) {
|
||||
int rgb = s->rgb;
|
||||
int pegasus_rct = s->pegasus_rct;
|
||||
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
|
||||
av_log(s->avctx, AV_LOG_INFO,
|
||||
"Pegasus lossless jpeg header found\n");
|
||||
@@ -1562,17 +1571,27 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
|
||||
skip_bits(&s->gb, 16); /* unknown always 0? */
|
||||
switch (i=get_bits(&s->gb, 8)) {
|
||||
case 1:
|
||||
s->rgb = 1;
|
||||
s->pegasus_rct = 0;
|
||||
rgb = 1;
|
||||
pegasus_rct = 0;
|
||||
break;
|
||||
case 2:
|
||||
s->rgb = 1;
|
||||
s->pegasus_rct = 1;
|
||||
rgb = 1;
|
||||
pegasus_rct = 1;
|
||||
break;
|
||||
default:
|
||||
av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace %d\n", i);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
if (id == AV_RL32("colr") && len > 0) {
|
||||
@@ -1826,6 +1845,10 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
|
||||
put_bits(&pb, 8, x);
|
||||
if (x == 0xFF) {
|
||||
x = src[b++];
|
||||
if (x & 0x80) {
|
||||
av_log(s->avctx, AV_LOG_WARNING, "Invalid escape sequence\n");
|
||||
x &= 0x7f;
|
||||
}
|
||||
put_bits(&pb, 7, x);
|
||||
bit_count--;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,13 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)
|
||||
|
||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||
|
||||
if (!avctx->width || !avctx->height ||
|
||||
(avctx->width & 1) || (avctx->height & 1)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid video dimensions: %dx%d\n",
|
||||
avctx->width, avctx->height);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
s->frame = av_frame_alloc();
|
||||
if (!s->frame)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -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 */
|
||||
if(dxy){
|
||||
if(qpel){
|
||||
c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); //FIXME prototype (add h)
|
||||
if (h << size == 16) {
|
||||
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){
|
||||
int cx= hx/2;
|
||||
int cy= hy/2;
|
||||
|
||||
@@ -73,20 +73,21 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
|
||||
if (i > 4)
|
||||
s->header_count = -2;
|
||||
} else {
|
||||
int header_threshold = avctx->codec_id != AV_CODEC_ID_NONE && avctx->codec_id != codec_id;
|
||||
if((state&SAME_HEADER_MASK) != (s->header&SAME_HEADER_MASK) && s->header)
|
||||
s->header_count= -3;
|
||||
s->header= state;
|
||||
s->header_count++;
|
||||
s->frame_size = ret-4;
|
||||
|
||||
if (s->header_count > 0 + (avctx->codec_id != AV_CODEC_ID_NONE && avctx->codec_id != codec_id)) {
|
||||
if (s->header_count > header_threshold) {
|
||||
avctx->sample_rate= sr;
|
||||
avctx->channels = channels;
|
||||
s1->duration = frame_size;
|
||||
avctx->codec_id = codec_id;
|
||||
if (s->no_bitrate || !avctx->bit_rate) {
|
||||
s->no_bitrate = 1;
|
||||
avctx->bit_rate += (bit_rate - avctx->bit_rate) / s->header_count;
|
||||
avctx->bit_rate += (bit_rate - avctx->bit_rate) / (s->header_count - header_threshold);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -348,18 +348,18 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
|
||||
switch(avctx->codec_id) {
|
||||
case AV_CODEC_ID_MPEG1VIDEO:
|
||||
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;
|
||||
case AV_CODEC_ID_MPEG4:
|
||||
case AV_CODEC_ID_MSMPEG4V1:
|
||||
case AV_CODEC_ID_MSMPEG4V2:
|
||||
case AV_CODEC_ID_MSMPEG4V3:
|
||||
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) {
|
||||
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) {
|
||||
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
|
||||
avctx->rc_buffer_size = 40;
|
||||
avctx->rc_buffer_size *= 16384;
|
||||
|
||||
@@ -94,8 +94,8 @@ static const AVOption avcodec_options[] = {
|
||||
{"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},
|
||||
{"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},
|
||||
{"ac", "set number of audio channels", OFFSET(channels), 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 }, 0, INT_MAX, A|D|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_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
||||
|
||||
@@ -565,6 +565,12 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
case MKTAG('I', 'H', 'D', 'R'):
|
||||
if (length != 13)
|
||||
goto fail;
|
||||
|
||||
if (s->state & PNG_IDAT) {
|
||||
av_log(avctx, AV_LOG_ERROR, "IHDR after IDAT\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
s->width = bytestream2_get_be32(&s->gb);
|
||||
s->height = bytestream2_get_be32(&s->gb);
|
||||
if (av_image_check_size(s->width, s->height, 0, avctx)) {
|
||||
|
||||
+7
-6
@@ -120,12 +120,13 @@ static void av_noinline qpeg_decode_inter(QpegContext *qctx, uint8_t *dst,
|
||||
int filled = 0;
|
||||
int orig_height;
|
||||
|
||||
if(!refdata)
|
||||
refdata= dst;
|
||||
|
||||
/* copy prev frame */
|
||||
for(i = 0; i < height; i++)
|
||||
memcpy(dst + (i * stride), refdata + (i * stride), width);
|
||||
if (refdata) {
|
||||
/* copy prev frame */
|
||||
for (i = 0; i < height; i++)
|
||||
memcpy(dst + (i * stride), refdata + (i * stride), width);
|
||||
} else {
|
||||
refdata = dst;
|
||||
}
|
||||
|
||||
orig_height = height;
|
||||
height--;
|
||||
|
||||
@@ -136,6 +136,9 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
|
||||
context->frame_size = avpicture_get_size(avctx->pix_fmt, avctx->width,
|
||||
avctx->height);
|
||||
}
|
||||
if (context->frame_size < 0)
|
||||
return context->frame_size;
|
||||
|
||||
|
||||
if ((avctx->extradata_size >= 9 &&
|
||||
!memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9)) ||
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ typedef struct SmcContext {
|
||||
row_ptr += stride * 4; \
|
||||
} \
|
||||
total_blocks--; \
|
||||
if (total_blocks < 0 + !!n_blocks) \
|
||||
if (total_blocks < !!n_blocks) \
|
||||
{ \
|
||||
av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
|
||||
return; \
|
||||
|
||||
+9
-1
@@ -65,6 +65,9 @@
|
||||
#include "compat/os2threads.h"
|
||||
#endif
|
||||
|
||||
#include "libavutil/ffversion.h"
|
||||
const char av_codec_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||
|
||||
#if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS
|
||||
static int default_lockmgr_cb(void **arg, enum AVLockOp op)
|
||||
{
|
||||
@@ -281,7 +284,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
||||
int i;
|
||||
int w_align = 1;
|
||||
int h_align = 1;
|
||||
AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt);
|
||||
AVPixFmtDescriptor const *desc = av_pix_fmt_desc_get(s->pix_fmt);
|
||||
|
||||
if (desc) {
|
||||
w_align = 1 << desc->log2_chroma_w;
|
||||
@@ -3482,6 +3485,11 @@ int avpriv_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf)
|
||||
ret = av_bprint_finalize(buf, &str);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (!av_bprint_is_complete(buf)) {
|
||||
av_free(str);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
avctx->extradata = str;
|
||||
/* 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
|
||||
|
||||
@@ -212,6 +212,8 @@ static void restore_median(uint8_t *src, int step, int stride,
|
||||
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
||||
slice_start;
|
||||
|
||||
if (!slice_height)
|
||||
continue;
|
||||
bsrc = src + slice_start * stride;
|
||||
|
||||
// first line - left neighbour prediction
|
||||
@@ -222,7 +224,7 @@ static void restore_median(uint8_t *src, int step, int stride,
|
||||
A = bsrc[i];
|
||||
}
|
||||
bsrc += stride;
|
||||
if (slice_height == 1)
|
||||
if (slice_height <= 1)
|
||||
continue;
|
||||
// second line - first element has top prediction, the rest uses median
|
||||
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_start;
|
||||
slice_height >>= 1;
|
||||
if (!slice_height)
|
||||
continue;
|
||||
|
||||
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];
|
||||
}
|
||||
bsrc += stride2;
|
||||
if (slice_height == 1)
|
||||
if (slice_height <= 1)
|
||||
continue;
|
||||
// second line - first element has top prediction, the rest uses median
|
||||
C = bsrc[-stride2];
|
||||
|
||||
@@ -352,6 +352,9 @@ static int vmd_decode(VmdVideoContext *s, AVFrame *frame)
|
||||
ofs += slen;
|
||||
bytestream2_skip(&gb, len);
|
||||
} else {
|
||||
if (ofs + len > frame_width ||
|
||||
bytestream2_get_bytes_left(&gb) < len)
|
||||
return AVERROR_INVALIDDATA;
|
||||
bytestream2_get_buffer(&gb, &dp[ofs], len);
|
||||
ofs += len;
|
||||
}
|
||||
|
||||
@@ -77,6 +77,8 @@ static int parse(AVCodecParserContext *ctx,
|
||||
idx += a; \
|
||||
if (sz > size) { \
|
||||
s->n_frames = 0; \
|
||||
*out_size = 0; \
|
||||
*out_data = data; \
|
||||
av_log(avctx, AV_LOG_ERROR, \
|
||||
"Superframe packet size too big: %u > %d\n", \
|
||||
sz, size); \
|
||||
|
||||
@@ -420,6 +420,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
offset &= ~3;
|
||||
if (offset > s->sfb_offsets[i][band - 1])
|
||||
s->sfb_offsets[i][band++] = offset;
|
||||
|
||||
if (offset >= subframe_len)
|
||||
break;
|
||||
}
|
||||
s->sfb_offsets[i][band - 1] = subframe_len;
|
||||
s->num_sfb[i] = band - 1;
|
||||
|
||||
@@ -34,7 +34,7 @@ OBJS-$(CONFIG_OPENGL_OUTDEV) += opengl_enc.o
|
||||
OBJS-$(CONFIG_OSS_INDEV) += oss_audio.o
|
||||
OBJS-$(CONFIG_OSS_OUTDEV) += oss_audio.o
|
||||
OBJS-$(CONFIG_PULSE_INDEV) += pulse_audio_dec.o \
|
||||
pulse_audio_common.o
|
||||
pulse_audio_common.o timefilter.o
|
||||
OBJS-$(CONFIG_PULSE_OUTDEV) += pulse_audio_enc.o \
|
||||
pulse_audio_common.o
|
||||
OBJS-$(CONFIG_SDL_OUTDEV) += sdl.o
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
#include "avdevice.h"
|
||||
#include "config.h"
|
||||
|
||||
#include "libavutil/ffversion.h"
|
||||
const char av_device_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||
|
||||
unsigned avdevice_version(void)
|
||||
{
|
||||
av_assert0(LIBAVDEVICE_VERSION_MICRO >= 100);
|
||||
@@ -48,9 +51,9 @@ int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToD
|
||||
int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type,
|
||||
void *data, size_t data_size)
|
||||
{
|
||||
if (!s->control_message_cb)
|
||||
if (!av_format_get_control_message_cb(s))
|
||||
return AVERROR(ENOSYS);
|
||||
return s->control_message_cb(s, type, data, data_size);
|
||||
return av_format_get_control_message_cb(s)(s, type, data, data_size);
|
||||
}
|
||||
|
||||
int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
|
||||
|
||||
+3
-3
@@ -871,9 +871,6 @@ static int v4l2_read_header(AVFormatContext *s1)
|
||||
|
||||
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
|
||||
|
||||
if ((res = v4l2_set_parameters(s1)) < 0)
|
||||
return res;
|
||||
|
||||
if (s->pixel_format) {
|
||||
AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format);
|
||||
|
||||
@@ -925,6 +922,9 @@ static int v4l2_read_header(AVFormatContext *s1)
|
||||
|
||||
s->frame_format = desired_format;
|
||||
|
||||
if ((res = v4l2_set_parameters(s1)) < 0)
|
||||
return res;
|
||||
|
||||
st->codec->pix_fmt = avpriv_fmt_v4l2ff(desired_format, codec_id);
|
||||
s->frame_size =
|
||||
avpicture_get_size(st->codec->pix_fmt, s->width, s->height);
|
||||
|
||||
@@ -496,6 +496,8 @@ static av_cold int init(AVFilterContext *ctx)
|
||||
snprintf(name, sizeof(name), "input%d", i);
|
||||
pad.type = AVMEDIA_TYPE_AUDIO;
|
||||
pad.name = av_strdup(name);
|
||||
if (!pad.name)
|
||||
return AVERROR(ENOMEM);
|
||||
pad.filter_frame = filter_frame;
|
||||
|
||||
ff_insert_inpad(ctx, i, &pad);
|
||||
|
||||
@@ -214,6 +214,8 @@ static av_cold int join_init(AVFilterContext *ctx)
|
||||
snprintf(name, sizeof(name), "input%d", i);
|
||||
pad.type = AVMEDIA_TYPE_AUDIO;
|
||||
pad.name = av_strdup(name);
|
||||
if (!pad.name)
|
||||
return AVERROR(ENOMEM);
|
||||
pad.filter_frame = filter_frame;
|
||||
|
||||
pad.needs_fifo = 1;
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#include "formats.h"
|
||||
#include "internal.h"
|
||||
|
||||
#include "libavutil/ffversion.h"
|
||||
const char av_filter_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||
|
||||
static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame);
|
||||
|
||||
void ff_tlog_ref(void *ctx, AVFrame *ref, int end)
|
||||
|
||||
@@ -52,6 +52,8 @@ static av_cold int split_init(AVFilterContext *ctx)
|
||||
snprintf(name, sizeof(name), "output%d", i);
|
||||
pad.type = ctx->filter->inputs[0].type;
|
||||
pad.name = av_strdup(name);
|
||||
if (!pad.name)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
ff_insert_outpad(ctx, i, &pad);
|
||||
}
|
||||
|
||||
@@ -292,6 +292,8 @@ static av_cold int movie_common_init(AVFilterContext *ctx)
|
||||
snprintf(name, sizeof(name), "out%d", i);
|
||||
pad.type = movie->st[i].st->codec->codec_type;
|
||||
pad.name = av_strdup(name);
|
||||
if (!pad.name)
|
||||
return AVERROR(ENOMEM);
|
||||
pad.config_props = movie_config_output_props;
|
||||
pad.request_frame = movie_request_frame;
|
||||
ff_insert_outpad(ctx, i, &pad);
|
||||
|
||||
@@ -82,6 +82,7 @@ static int config_output(AVFilterLink *outlink)
|
||||
int width = ctx->inputs[LEFT]->w;
|
||||
int height = ctx->inputs[LEFT]->h;
|
||||
AVRational time_base = ctx->inputs[LEFT]->time_base;
|
||||
AVRational frame_rate = ctx->inputs[LEFT]->frame_rate;
|
||||
|
||||
// check size and fps match on the other input
|
||||
if (width != ctx->inputs[RIGHT]->w ||
|
||||
@@ -93,11 +94,18 @@ static int config_output(AVFilterLink *outlink)
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else if (av_cmp_q(time_base, ctx->inputs[RIGHT]->time_base) != 0) {
|
||||
av_log(ctx, AV_LOG_ERROR,
|
||||
"Left and right framerates differ (%d/%d vs %d/%d).\n",
|
||||
"Left and right time bases differ (%d/%d vs %d/%d).\n",
|
||||
time_base.num, time_base.den,
|
||||
ctx->inputs[RIGHT]->time_base.num,
|
||||
ctx->inputs[RIGHT]->time_base.den);
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else if (av_cmp_q(frame_rate, ctx->inputs[RIGHT]->frame_rate) != 0) {
|
||||
av_log(ctx, AV_LOG_ERROR,
|
||||
"Left and right framerates differ (%d/%d vs %d/%d).\n",
|
||||
frame_rate.num, frame_rate.den,
|
||||
ctx->inputs[RIGHT]->frame_rate.num,
|
||||
ctx->inputs[RIGHT]->frame_rate.den);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
s->pix_desc = av_pix_fmt_desc_get(outlink->format);
|
||||
@@ -108,6 +116,8 @@ static int config_output(AVFilterLink *outlink)
|
||||
switch (s->format) {
|
||||
case AV_STEREO3D_FRAMESEQUENCE:
|
||||
time_base.den *= 2;
|
||||
frame_rate.num *= 2;
|
||||
|
||||
s->double_pts = AV_NOPTS_VALUE;
|
||||
break;
|
||||
case AV_STEREO3D_COLUMNS:
|
||||
@@ -126,6 +136,7 @@ static int config_output(AVFilterLink *outlink)
|
||||
outlink->w = width;
|
||||
outlink->h = height;
|
||||
outlink->time_base = time_base;
|
||||
outlink->frame_rate= frame_rate;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+16
-6
@@ -220,6 +220,19 @@ static int config_props(AVFilterLink *inlink)
|
||||
|
||||
#define NB_PLANES 4
|
||||
|
||||
static inline int mirror(int x, int w)
|
||||
{
|
||||
if (!w)
|
||||
return 0;
|
||||
|
||||
while ((unsigned)x > (unsigned)w) {
|
||||
x = -x;
|
||||
if (x < 0)
|
||||
x += 2 * w;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
static void blur(uint8_t *dst, const int dst_linesize,
|
||||
const uint8_t *src, const int src_linesize,
|
||||
const int w, const int h, FilterParam *fp)
|
||||
@@ -253,8 +266,7 @@ static void blur(uint8_t *dst, const int dst_linesize,
|
||||
for (dy = 0; dy < radius*2 + 1; dy++) {
|
||||
int dx;
|
||||
int iy = y+dy - radius;
|
||||
if (iy < 0) iy = -iy;
|
||||
else if (iy >= h) iy = h+h-iy-1;
|
||||
iy = mirror(iy, h-1);
|
||||
|
||||
for (dx = 0; dx < radius*2 + 1; dx++) {
|
||||
const int ix = x+dx - radius;
|
||||
@@ -265,13 +277,11 @@ static void blur(uint8_t *dst, const int dst_linesize,
|
||||
for (dy = 0; dy < radius*2+1; dy++) {
|
||||
int dx;
|
||||
int iy = y+dy - radius;
|
||||
if (iy < 0) iy = -iy;
|
||||
else if (iy >= h) iy = h+h-iy-1;
|
||||
iy = mirror(iy, h-1);
|
||||
|
||||
for (dx = 0; dx < radius*2 + 1; dx++) {
|
||||
int ix = x+dx - radius;
|
||||
if (ix < 0) ix = -ix;
|
||||
else if (ix >= w) ix = w+w-ix-1;
|
||||
ix = mirror(ix, w-1);
|
||||
UPDATE_FACTOR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1046,7 +1046,7 @@ start_sync:
|
||||
goto start_sync;
|
||||
}
|
||||
|
||||
n = avi->dv_demux ? 0 : get_stream_idx(d);
|
||||
n = get_stream_idx(d);
|
||||
|
||||
if (!((i - avi->last_pkt_pos) & 1) &&
|
||||
get_stream_idx(d + 1) < s->nb_streams)
|
||||
@@ -1058,6 +1058,9 @@ start_sync:
|
||||
goto start_sync;
|
||||
}
|
||||
|
||||
if (avi->dv_demux && n != 0)
|
||||
continue;
|
||||
|
||||
// parse ##dc/##wb
|
||||
if (n < s->nb_streams) {
|
||||
AVStream *st;
|
||||
|
||||
@@ -219,6 +219,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
|
||||
return offset1;
|
||||
offset += offset1;
|
||||
}
|
||||
if (offset < 0)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
offset1 = offset - pos;
|
||||
if (!s->must_flush && (!s->direct || !s->seek) &&
|
||||
offset1 >= 0 && offset1 <= buffer_size) {
|
||||
|
||||
@@ -127,6 +127,8 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
height = AV_RB16(&cdxl->header[16]);
|
||||
palette_size = AV_RB16(&cdxl->header[20]);
|
||||
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;
|
||||
video_size = palette_size + image_size;
|
||||
|
||||
|
||||
@@ -376,7 +376,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
|
||||
FLVContext *flv = s->priv_data;
|
||||
AVIOContext *ioc;
|
||||
AMFDataType amf_type;
|
||||
char str_val[256];
|
||||
char str_val[1024];
|
||||
double num_val;
|
||||
|
||||
num_val = 0;
|
||||
@@ -541,13 +541,13 @@ static int flv_read_metabody(AVFormatContext *s, int64_t next_pos)
|
||||
type = avio_r8(ioc);
|
||||
if (type != AMF_DATA_TYPE_STRING ||
|
||||
amf_get_string(ioc, buffer, sizeof(buffer)) < 0)
|
||||
return -1;
|
||||
return 2;
|
||||
|
||||
if (!strcmp(buffer, "onTextData"))
|
||||
return 1;
|
||||
|
||||
if (strcmp(buffer, "onMetaData"))
|
||||
return -1;
|
||||
return 2;
|
||||
|
||||
// find the streams now so that amf_parse_object doesn't need to do
|
||||
// the lookup every time it is called.
|
||||
@@ -614,7 +614,7 @@ static int flv_read_close(AVFormatContext *s)
|
||||
|
||||
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
|
||||
{
|
||||
av_free(st->codec->extradata);
|
||||
av_freep(&st->codec->extradata);
|
||||
if (ff_get_extradata(st->codec, s->pb, size) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
return 0;
|
||||
@@ -813,7 +813,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
stream_type=FLV_STREAM_TYPE_DATA;
|
||||
if (size > 13 + 1 + 4 && dts == 0) { // Header-type metadata stuff
|
||||
meta_pos = avio_tell(s->pb);
|
||||
if (flv_read_metabody(s, next) == 0) {
|
||||
if (flv_read_metabody(s, next) <= 0) {
|
||||
goto skip;
|
||||
}
|
||||
avio_seek(s->pb, meta_pos, SEEK_SET);
|
||||
|
||||
@@ -145,15 +145,15 @@ static void hds_free(AVFormatContext *s)
|
||||
if (os->ctx && os->ctx_inited)
|
||||
av_write_trailer(os->ctx);
|
||||
if (os->ctx && os->ctx->pb)
|
||||
av_free(os->ctx->pb);
|
||||
av_freep(&os->ctx->pb);
|
||||
if (os->ctx)
|
||||
avformat_free_context(os->ctx);
|
||||
av_free(os->metadata);
|
||||
av_freep(&os->metadata);
|
||||
for (j = 0; j < os->nb_extra_packets; j++)
|
||||
av_free(os->extra_packets[j]);
|
||||
av_freep(&os->extra_packets[j]);
|
||||
for (j = 0; j < os->nb_fragments; j++)
|
||||
av_free(os->fragments[j]);
|
||||
av_free(os->fragments);
|
||||
av_freep(&os->fragments[j]);
|
||||
av_freep(&os->fragments);
|
||||
}
|
||||
av_freep(&c->streams);
|
||||
}
|
||||
@@ -509,7 +509,7 @@ static int hds_flush(AVFormatContext *s, OutputStream *os, int final,
|
||||
if (remove > 0) {
|
||||
for (i = 0; i < remove; i++) {
|
||||
unlink(os->fragments[i]->file);
|
||||
av_free(os->fragments[i]);
|
||||
av_freep(&os->fragments[i]);
|
||||
}
|
||||
os->nb_fragments -= remove;
|
||||
memmove(os->fragments, os->fragments + remove,
|
||||
|
||||
@@ -308,9 +308,10 @@ static int hls_write_trailer(struct AVFormatContext *s)
|
||||
|
||||
av_write_trailer(oc);
|
||||
avio_closep(&oc->pb);
|
||||
avformat_free_context(oc);
|
||||
av_free(hls->basename);
|
||||
append_entry(hls, hls->duration);
|
||||
avformat_free_context(oc);
|
||||
hls->avf = NULL;
|
||||
hls_window(s, 1);
|
||||
|
||||
free_entries(hls);
|
||||
|
||||
@@ -167,6 +167,7 @@ typedef struct MOVContext {
|
||||
int64_t next_root_atom; ///< offset of the next root atom
|
||||
int *bitrates; ///< bitrates read before streams creation
|
||||
int bitrates_count;
|
||||
int atom_depth;
|
||||
} MOVContext;
|
||||
|
||||
int ff_mp4_read_descr_len(AVIOContext *pb);
|
||||
|
||||
@@ -1051,7 +1051,7 @@ static void ebml_free(EbmlSyntax *syntax, void *data)
|
||||
char *ptr = list->elem;
|
||||
for (j=0; j<list->nb_elem; j++, ptr+=syntax[i].list_elem_size)
|
||||
ebml_free(syntax[i].def.n, ptr);
|
||||
av_free(list->elem);
|
||||
av_freep(&list->elem);
|
||||
} else
|
||||
ebml_free(syntax[i].def.n, data_off);
|
||||
default: break;
|
||||
@@ -1427,13 +1427,17 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)
|
||||
EbmlList *seekhead_list = &matroska->seekhead;
|
||||
int64_t before_pos = avio_tell(matroska->ctx->pb);
|
||||
int i;
|
||||
int nb_elem;
|
||||
|
||||
// we should not do any seeking in the streaming case
|
||||
if (!matroska->ctx->pb->seekable ||
|
||||
(matroska->ctx->flags & AVFMT_FLAG_IGNIDX))
|
||||
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;
|
||||
if (seekhead[i].pos <= before_pos)
|
||||
continue;
|
||||
@@ -1903,8 +1907,8 @@ static int matroska_read_header(AVFormatContext *s)
|
||||
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
|
||||
1000000000, track->default_duration, 30000);
|
||||
#if FF_API_R_FRAME_RATE
|
||||
if ( st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L
|
||||
&& st->avg_frame_rate.num > st->avg_frame_rate.den * 5L)
|
||||
if ( st->avg_frame_rate.num < st->avg_frame_rate.den * 1000LL
|
||||
&& st->avg_frame_rate.num > st->avg_frame_rate.den * 5LL)
|
||||
st->r_frame_rate = st->avg_frame_rate;
|
||||
#endif
|
||||
}
|
||||
@@ -2029,7 +2033,7 @@ static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
|
||||
{
|
||||
if (matroska->num_packets > 0) {
|
||||
memcpy(pkt, matroska->packets[0], sizeof(AVPacket));
|
||||
av_free(matroska->packets[0]);
|
||||
av_freep(&matroska->packets[0]);
|
||||
if (matroska->num_packets > 1) {
|
||||
void *newpackets;
|
||||
memmove(&matroska->packets[0], &matroska->packets[1],
|
||||
@@ -2059,7 +2063,7 @@ static void matroska_clear_queue(MatroskaDemuxContext *matroska)
|
||||
int n;
|
||||
for (n = 0; n < matroska->num_packets; n++) {
|
||||
av_free_packet(matroska->packets[n]);
|
||||
av_free(matroska->packets[n]);
|
||||
av_freep(&matroska->packets[n]);
|
||||
}
|
||||
av_freep(&matroska->packets);
|
||||
matroska->num_packets = 0;
|
||||
@@ -2818,7 +2822,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
|
||||
int64_t timestamp, int flags)
|
||||
{
|
||||
MatroskaDemuxContext *matroska = s->priv_data;
|
||||
MatroskaTrack *tracks = matroska->tracks.elem;
|
||||
MatroskaTrack *tracks = NULL;
|
||||
AVStream *st = s->streams[stream_index];
|
||||
int i, index, index_sub, index_min;
|
||||
|
||||
@@ -2847,6 +2851,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
|
||||
goto err;
|
||||
|
||||
index_min = index;
|
||||
tracks = matroska->tracks.elem;
|
||||
for (i=0; i < matroska->tracks.nb_elem; i++) {
|
||||
tracks[i].audio.pkt_cnt = 0;
|
||||
tracks[i].audio.sub_packet_cnt = 0;
|
||||
@@ -2899,7 +2904,7 @@ static int matroska_read_close(AVFormatContext *s)
|
||||
|
||||
for (n=0; n < matroska->tracks.nb_elem; n++)
|
||||
if (tracks[n].type == MATROSKA_TRACK_TYPE_AUDIO)
|
||||
av_free(tracks[n].audio.buf);
|
||||
av_freep(&tracks[n].audio.buf);
|
||||
ebml_free(matroska_cluster, &matroska->current_cluster);
|
||||
ebml_free(matroska_segment, matroska);
|
||||
|
||||
|
||||
+57
-26
@@ -279,7 +279,11 @@ static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
|
||||
static int mov_metadata_raw(MOVContext *c, AVIOContext *pb,
|
||||
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)
|
||||
return AVERROR(ENOMEM);
|
||||
avio_read(pb, value, len);
|
||||
@@ -383,7 +387,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
|
||||
if (!key)
|
||||
return 0;
|
||||
if (atom.size < 0)
|
||||
if (atom.size < 0 || str_size >= INT_MAX/2)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
str_size = FFMIN3(sizeof(str)-1, str_size, atom.size);
|
||||
@@ -1200,10 +1204,12 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
|
||||
if (!entries)
|
||||
return 0;
|
||||
if (entries >= UINT_MAX/sizeof(int64_t))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
sc->chunk_offsets = av_malloc(entries * sizeof(int64_t));
|
||||
if (sc->chunk_offsets)
|
||||
av_log(c->fc, AV_LOG_WARNING, "Duplicate STCO atom\n");
|
||||
av_free(sc->chunk_offsets);
|
||||
sc->chunk_count = 0;
|
||||
sc->chunk_offsets = av_malloc_array(entries, sizeof(*sc->chunk_offsets));
|
||||
if (!sc->chunk_offsets)
|
||||
return AVERROR(ENOMEM);
|
||||
sc->chunk_count = entries;
|
||||
@@ -1474,7 +1480,7 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
|
||||
|
||||
static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb,
|
||||
AVStream *st, MOVStreamContext *sc,
|
||||
int size)
|
||||
int64_t size)
|
||||
{
|
||||
// ttxt stsd contains display flags, justification, background
|
||||
// color, fonts, and default styles, so fake an atom to read it
|
||||
@@ -1488,10 +1494,10 @@ static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb,
|
||||
|
||||
static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
|
||||
AVStream *st, MOVStreamContext *sc,
|
||||
int size)
|
||||
int64_t size)
|
||||
{
|
||||
if (st->codec->codec_tag == MKTAG('t','m','c','d')) {
|
||||
if (ff_get_extradata(st->codec, pb, size) < 0)
|
||||
if ((int)size != size || ff_get_extradata(st->codec, pb, size) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
if (size > 16) {
|
||||
MOVStreamContext *tmcd_ctx = st->priv_data;
|
||||
@@ -1716,9 +1722,11 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
|
||||
if (!entries)
|
||||
return 0;
|
||||
if (entries >= UINT_MAX / sizeof(*sc->stsc_data))
|
||||
return AVERROR_INVALIDDATA;
|
||||
sc->stsc_data = av_malloc(entries * sizeof(*sc->stsc_data));
|
||||
if (sc->stsc_data)
|
||||
av_log(c->fc, AV_LOG_WARNING, "Duplicate STSC atom\n");
|
||||
av_free(sc->stsc_data);
|
||||
sc->stsc_count = 0;
|
||||
sc->stsc_data = av_malloc_array(entries, sizeof(*sc->stsc_data));
|
||||
if (!sc->stsc_data)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -1750,9 +1758,11 @@ static int mov_read_stps(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
avio_rb32(pb); // version + flags
|
||||
|
||||
entries = avio_rb32(pb);
|
||||
if (entries >= UINT_MAX / sizeof(*sc->stps_data))
|
||||
return AVERROR_INVALIDDATA;
|
||||
sc->stps_data = av_malloc(entries * sizeof(*sc->stps_data));
|
||||
if (sc->stps_data)
|
||||
av_log(c->fc, AV_LOG_WARNING, "Duplicate STPS atom\n");
|
||||
av_free(sc->stps_data);
|
||||
sc->stps_count = 0;
|
||||
sc->stps_data = av_malloc_array(entries, sizeof(*sc->stps_data));
|
||||
if (!sc->stps_data)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -1794,9 +1804,13 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
st->need_parsing = AVSTREAM_PARSE_HEADERS;
|
||||
return 0;
|
||||
}
|
||||
if (sc->keyframes)
|
||||
av_log(c->fc, AV_LOG_WARNING, "Duplicated STSS atom\n");
|
||||
if (entries >= UINT_MAX / sizeof(int))
|
||||
return AVERROR_INVALIDDATA;
|
||||
sc->keyframes = av_malloc(entries * sizeof(int));
|
||||
av_freep(&sc->keyframes);
|
||||
sc->keyframe_count = 0;
|
||||
sc->keyframes = av_malloc_array(entries, sizeof(*sc->keyframes));
|
||||
if (!sc->keyframes)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -1855,9 +1869,13 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
|
||||
if (!entries)
|
||||
return 0;
|
||||
if (entries >= UINT_MAX / sizeof(int) || entries >= (UINT_MAX - 4) / field_size)
|
||||
if (entries >= (UINT_MAX - 4) / field_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
sc->sample_sizes = av_malloc(entries * sizeof(int));
|
||||
if (sc->sample_sizes)
|
||||
av_log(c->fc, AV_LOG_WARNING, "Duplicate STSZ atom\n");
|
||||
av_free(sc->sample_sizes);
|
||||
sc->sample_count = 0;
|
||||
sc->sample_sizes = av_malloc_array(entries, sizeof(*sc->sample_sizes));
|
||||
if (!sc->sample_sizes)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -1911,11 +1929,11 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
av_dlog(c->fc, "track[%i].stts.entries = %i\n",
|
||||
c->fc->nb_streams-1, entries);
|
||||
|
||||
if (entries >= UINT_MAX / sizeof(*sc->stts_data))
|
||||
return -1;
|
||||
|
||||
if (sc->stts_data)
|
||||
av_log(c->fc, AV_LOG_WARNING, "Duplicate STTS atom\n");
|
||||
av_free(sc->stts_data);
|
||||
sc->stts_data = av_malloc(entries * sizeof(*sc->stts_data));
|
||||
sc->stts_count = 0;
|
||||
sc->stts_data = av_malloc_array(entries, sizeof(*sc->stts_data));
|
||||
if (!sc->stts_data)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -2054,9 +2072,11 @@ static int mov_read_sbgp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
entries = avio_rb32(pb);
|
||||
if (!entries)
|
||||
return 0;
|
||||
if (entries >= UINT_MAX / sizeof(*sc->rap_group))
|
||||
return AVERROR_INVALIDDATA;
|
||||
sc->rap_group = av_malloc(entries * sizeof(*sc->rap_group));
|
||||
if (sc->rap_group)
|
||||
av_log(c->fc, AV_LOG_WARNING, "Duplicate SBGP atom\n");
|
||||
av_free(sc->rap_group);
|
||||
sc->rap_group_count = 0;
|
||||
sc->rap_group = av_malloc_array(entries, sizeof(*sc->rap_group));
|
||||
if (!sc->rap_group)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
@@ -3006,6 +3026,12 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
MOVAtom a;
|
||||
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)
|
||||
atom.size = INT64_MAX;
|
||||
while (total_size + 8 <= atom.size && !url_feof(pb)) {
|
||||
@@ -3022,11 +3048,12 @@ 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");
|
||||
avio_skip(pb, -8);
|
||||
c->atom_depth --;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
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;
|
||||
total_size += 8;
|
||||
}
|
||||
@@ -3058,13 +3085,16 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
int64_t start_pos = avio_tell(pb);
|
||||
int64_t left;
|
||||
int err = parse(c, pb, a);
|
||||
if (err < 0)
|
||||
if (err < 0) {
|
||||
c->atom_depth --;
|
||||
return err;
|
||||
}
|
||||
if (c->found_moov && c->found_mdat &&
|
||||
((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) ||
|
||||
start_pos + a.size == avio_size(pb))) {
|
||||
if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX)
|
||||
c->next_root_atom = start_pos + a.size;
|
||||
c->atom_depth --;
|
||||
return 0;
|
||||
}
|
||||
left = a.size - avio_tell(pb) + start_pos;
|
||||
@@ -3084,6 +3114,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
if (total_size < atom.size && atom.size < 0x7ffff)
|
||||
avio_skip(pb, atom.size - total_size);
|
||||
|
||||
c->atom_depth --;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2033,7 +2033,8 @@ static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov)
|
||||
}
|
||||
|
||||
version = max_track_len < UINT32_MAX ? 0 : 1;
|
||||
(version == 1) ? avio_wb32(pb, 120) : avio_wb32(pb, 108); /* size */
|
||||
avio_wb32(pb, version == 1 ? 120 : 108); /* size */
|
||||
|
||||
ffio_wfourcc(pb, "mvhd");
|
||||
avio_w8(pb, version);
|
||||
avio_wb24(pb, 0); /* flags */
|
||||
|
||||
+7
-3
@@ -57,7 +57,7 @@ typedef struct {
|
||||
|
||||
static inline int64_t bs_get_v(const uint8_t **bs)
|
||||
{
|
||||
int64_t v = 0;
|
||||
uint64_t v = 0;
|
||||
int br = 0;
|
||||
int c;
|
||||
|
||||
@@ -91,7 +91,7 @@ static int mpc8_probe(AVProbeData *p)
|
||||
size = bs_get_v(&bs);
|
||||
if (size < 2)
|
||||
return 0;
|
||||
if (bs + size - 2 >= bs_end)
|
||||
if (size >= bs_end - bs + 2)
|
||||
return AVPROBE_SCORE_EXTENSION - 1; // seems to be valid MPC but no header yet
|
||||
if (header_found) {
|
||||
if (size < 11 || size > 28)
|
||||
@@ -108,7 +108,7 @@ static int mpc8_probe(AVProbeData *p)
|
||||
|
||||
static inline int64_t gb_get_v(GetBitContext *gb)
|
||||
{
|
||||
int64_t v = 0;
|
||||
uint64_t v = 0;
|
||||
int bits = 0;
|
||||
while(get_bits1(gb) && bits < 64-7){
|
||||
v <<= 7;
|
||||
@@ -223,6 +223,10 @@ static int mpc8_read_header(AVFormatContext *s)
|
||||
while(!url_feof(pb)){
|
||||
pos = avio_tell(pb);
|
||||
mpc8_get_chunk_header(pb, &tag, &size);
|
||||
if (size < 0) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid chunk length\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if(tag == TAG_STREAMHDR)
|
||||
break;
|
||||
mpc8_handle_chunk(s, tag, pos, size);
|
||||
|
||||
@@ -172,7 +172,7 @@ static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size,
|
||||
taglen = AV_RB32(&enc_header[pos + 32]);
|
||||
datalen = AV_RB32(&enc_header[pos + 36]) >> 4;
|
||||
|
||||
pos += 44L + taglen;
|
||||
pos += 44LL + taglen;
|
||||
|
||||
if (pos + (((uint64_t)datalen) << 4) > size)
|
||||
return -1;
|
||||
|
||||
+8
-1
@@ -312,6 +312,9 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
|
||||
int64_t codec_pos;
|
||||
int ret;
|
||||
|
||||
if (codec_data_size < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
avpriv_set_pts_info(st, 64, 1, 1000);
|
||||
codec_pos = avio_tell(pb);
|
||||
v = avio_rb32(pb);
|
||||
@@ -394,7 +397,11 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
|
||||
skip:
|
||||
/* skip codec info */
|
||||
size = avio_tell(pb) - codec_pos;
|
||||
avio_skip(pb, codec_data_size - size);
|
||||
if (codec_data_size >= size) {
|
||||
avio_skip(pb, codec_data_size - size);
|
||||
} else {
|
||||
av_log(s, AV_LOG_WARNING, "codec_data_size %u < size %d\n", codec_data_size, size);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ static int rsd_read_header(AVFormatContext *s)
|
||||
codec->codec_tag = avio_rl32(pb);
|
||||
codec->codec_id = ff_codec_get_id(rsd_tags, codec->codec_tag);
|
||||
if (!codec->codec_id) {
|
||||
char tag_buf[5];
|
||||
char tag_buf[32];
|
||||
|
||||
av_get_codec_tag_string(tag_buf, sizeof(tag_buf), codec->codec_tag);
|
||||
for (i=0; i < FF_ARRAY_ELEMS(rsd_unsupported_tags); i++) {
|
||||
|
||||
@@ -321,7 +321,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last)
|
||||
if (seg->list_size && seg->segment_count > seg->list_size) {
|
||||
entry = seg->segment_list_entries;
|
||||
seg->segment_list_entries = seg->segment_list_entries->next;
|
||||
av_free(entry->filename);
|
||||
av_freep(&entry->filename);
|
||||
av_freep(&entry);
|
||||
}
|
||||
|
||||
@@ -479,10 +479,10 @@ static int open_null_ctx(AVIOContext **ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void close_null_ctx(AVIOContext *pb)
|
||||
static void close_null_ctxp(AVIOContext **pb)
|
||||
{
|
||||
av_free(pb->buffer);
|
||||
av_free(pb);
|
||||
av_freep(&(*pb)->buffer);
|
||||
av_freep(pb);
|
||||
}
|
||||
|
||||
static int select_reference_stream(AVFormatContext *s)
|
||||
@@ -638,7 +638,7 @@ static int seg_write_header(AVFormatContext *s)
|
||||
s->avoid_negative_ts = 1;
|
||||
|
||||
if (!seg->write_header_trailer) {
|
||||
close_null_ctx(oc->pb);
|
||||
close_null_ctxp(&oc->pb);
|
||||
if ((ret = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
|
||||
&s->interrupt_callback, NULL)) < 0)
|
||||
goto fail;
|
||||
@@ -743,7 +743,7 @@ static int seg_write_trailer(struct AVFormatContext *s)
|
||||
goto fail;
|
||||
open_null_ctx(&oc->pb);
|
||||
ret = av_write_trailer(oc);
|
||||
close_null_ctx(oc->pb);
|
||||
close_null_ctxp(&oc->pb);
|
||||
} else {
|
||||
ret = segment_end(s, 1, 1);
|
||||
}
|
||||
@@ -758,7 +758,7 @@ fail:
|
||||
cur = seg->segment_list_entries;
|
||||
while (cur) {
|
||||
next = cur->next;
|
||||
av_free(cur->filename);
|
||||
av_freep(&cur->filename);
|
||||
av_free(cur);
|
||||
cur = next;
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
int err;
|
||||
|
||||
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");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -184,6 +184,8 @@ static int thp_read_packet(AVFormatContext *s,
|
||||
pkt->stream_index = thp->video_stream_index;
|
||||
} else {
|
||||
ret = av_get_packet(pb, pkt, thp->audiosize);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret != thp->audiosize) {
|
||||
av_free_packet(pkt);
|
||||
return AVERROR(EIO);
|
||||
|
||||
+9
-2
@@ -118,8 +118,10 @@ static int tta_read_header(AVFormatContext *s)
|
||||
ffio_init_checksum(s->pb, tta_check_crc, UINT32_MAX);
|
||||
for (i = 0; i < c->totalframes; i++) {
|
||||
uint32_t size = avio_rl32(s->pb);
|
||||
av_add_index_entry(st, framepos, i * c->frame_size, size, 0,
|
||||
AVINDEX_KEYFRAME);
|
||||
int r;
|
||||
if ((r = av_add_index_entry(st, framepos, i * c->frame_size, size, 0,
|
||||
AVINDEX_KEYFRAME)) < 0)
|
||||
return r;
|
||||
framepos += size;
|
||||
}
|
||||
crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
|
||||
@@ -153,6 +155,11 @@ static int tta_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
if (c->currentframe >= c->totalframes)
|
||||
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;
|
||||
|
||||
ret = av_get_packet(s->pb, pkt, size);
|
||||
|
||||
+8
-2
@@ -53,6 +53,9 @@
|
||||
#include "riff.h"
|
||||
#include "url.h"
|
||||
|
||||
#include "libavutil/ffversion.h"
|
||||
const char av_format_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||
|
||||
/**
|
||||
* @file
|
||||
* various utility functions for use within FFmpeg
|
||||
@@ -706,6 +709,8 @@ static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_in
|
||||
int default_stream_index = av_find_default_stream_index(s);
|
||||
if (s->streams[default_stream_index]->pts_wrap_reference == AV_NOPTS_VALUE) {
|
||||
for (i = 0; i < s->nb_streams; i++) {
|
||||
if (av_find_program_from_stream(s, NULL, i))
|
||||
continue;
|
||||
s->streams[i]->pts_wrap_reference = pts_wrap_reference;
|
||||
s->streams[i]->pts_wrap_behavior = pts_wrap_behavior;
|
||||
}
|
||||
@@ -2842,8 +2847,8 @@ static int get_std_framerate(int i)
|
||||
* And there are "variable" fps files this needs to detect as well. */
|
||||
static int tb_unreliable(AVCodecContext *c)
|
||||
{
|
||||
if (c->time_base.den >= 101L * c->time_base.num ||
|
||||
c->time_base.den < 5L * c->time_base.num ||
|
||||
if (c->time_base.den >= 101LL * c->time_base.num ||
|
||||
c->time_base.den < 5LL * c->time_base.num ||
|
||||
// c->codec_tag == AV_RL32("DIVX") ||
|
||||
// c->codec_tag == AV_RL32("XVID") ||
|
||||
c->codec_tag == AV_RL32("mp4v") ||
|
||||
@@ -2865,6 +2870,7 @@ int ff_alloc_extradata(AVCodecContext *avctx, int size)
|
||||
int ret;
|
||||
|
||||
if (size < 0 || size >= INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
|
||||
avctx->extradata = NULL;
|
||||
avctx->extradata_size = 0;
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
+36
-1
@@ -23,6 +23,10 @@
|
||||
#include "buffer_internal.h"
|
||||
#include "common.h"
|
||||
#include "mem.h"
|
||||
#include "thread.h"
|
||||
|
||||
//#define USE_ATOMICS !(HAVE_PTHREADS || HAVE_W32THREADS)
|
||||
#define USE_ATOMICS 1 // can be changed to the above once it received more testing in master
|
||||
|
||||
AVBufferRef *av_buffer_create(uint8_t *data, int size,
|
||||
void (*free)(void *opaque, uint8_t *data),
|
||||
@@ -209,6 +213,8 @@ AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size))
|
||||
if (!pool)
|
||||
return NULL;
|
||||
|
||||
ff_mutex_init(&pool->mutex, NULL);
|
||||
|
||||
pool->size = size;
|
||||
pool->alloc = alloc ? alloc : av_buffer_alloc;
|
||||
|
||||
@@ -230,6 +236,7 @@ static void buffer_pool_free(AVBufferPool *pool)
|
||||
buf->free(buf->opaque, buf->data);
|
||||
av_freep(&buf);
|
||||
}
|
||||
ff_mutex_destroy(&pool->mutex);
|
||||
av_freep(&pool);
|
||||
}
|
||||
|
||||
@@ -290,7 +297,15 @@ static void pool_release_buffer(void *opaque, uint8_t *data)
|
||||
if(CONFIG_MEMORY_POISONING)
|
||||
memset(buf->data, FF_MEMORY_POISON, pool->size);
|
||||
|
||||
#if USE_ATOMICS
|
||||
add_to_pool(buf);
|
||||
#else
|
||||
ff_mutex_lock(&pool->mutex);
|
||||
buf->next = pool->pool;
|
||||
pool->pool = buf;
|
||||
ff_mutex_unlock(&pool->mutex);
|
||||
#endif
|
||||
|
||||
if (!avpriv_atomic_int_add_and_fetch(&pool->refcount, -1))
|
||||
buffer_pool_free(pool);
|
||||
}
|
||||
@@ -320,8 +335,10 @@ static AVBufferRef *pool_alloc_buffer(AVBufferPool *pool)
|
||||
ret->buffer->opaque = buf;
|
||||
ret->buffer->free = pool_release_buffer;
|
||||
|
||||
#if USE_ATOMICS
|
||||
avpriv_atomic_int_add_and_fetch(&pool->refcount, 1);
|
||||
avpriv_atomic_int_add_and_fetch(&pool->nb_allocated, 1);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -331,6 +348,7 @@ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool)
|
||||
AVBufferRef *ret;
|
||||
BufferPoolEntry *buf;
|
||||
|
||||
#if USE_ATOMICS
|
||||
/* check whether the pool is empty */
|
||||
buf = get_pool(pool);
|
||||
if (!buf && pool->refcount <= pool->nb_allocated) {
|
||||
@@ -352,7 +370,24 @@ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool)
|
||||
add_to_pool(buf);
|
||||
return NULL;
|
||||
}
|
||||
avpriv_atomic_int_add_and_fetch(&pool->refcount, 1);
|
||||
#else
|
||||
ff_mutex_lock(&pool->mutex);
|
||||
buf = pool->pool;
|
||||
if (buf) {
|
||||
ret = av_buffer_create(buf->data, pool->size, pool_release_buffer,
|
||||
buf, 0);
|
||||
if (ret) {
|
||||
pool->pool = buf->next;
|
||||
buf->next = NULL;
|
||||
}
|
||||
} else {
|
||||
ret = pool_alloc_buffer(pool);
|
||||
}
|
||||
ff_mutex_unlock(&pool->mutex);
|
||||
#endif
|
||||
|
||||
if (ret)
|
||||
avpriv_atomic_int_add_and_fetch(&pool->refcount, 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "buffer.h"
|
||||
#include "thread.h"
|
||||
|
||||
/**
|
||||
* The buffer is always treated as read-only.
|
||||
@@ -72,6 +73,7 @@ typedef struct BufferPoolEntry {
|
||||
} BufferPoolEntry;
|
||||
|
||||
struct AVBufferPool {
|
||||
AVMutex mutex;
|
||||
BufferPoolEntry * volatile pool;
|
||||
|
||||
/*
|
||||
|
||||
@@ -487,6 +487,7 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
|
||||
av_dict_free(&dst->side_data[i]->metadata);
|
||||
}
|
||||
av_freep(&dst->side_data);
|
||||
dst->nb_side_data = 0;
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
memcpy(sd_dst->data, sd_src->data, sd_src->size);
|
||||
|
||||
+12
-6
@@ -75,8 +75,8 @@ static int read_number(const AVOption *o, void *dst, double *num, int *den, int6
|
||||
{
|
||||
switch (o->type) {
|
||||
case AV_OPT_TYPE_FLAGS: *intnum = *(unsigned int*)dst;return 0;
|
||||
case AV_OPT_TYPE_PIXEL_FMT:
|
||||
case AV_OPT_TYPE_SAMPLE_FMT:
|
||||
case AV_OPT_TYPE_PIXEL_FMT: *intnum = *(enum AVPixelFormat *)dst;return 0;
|
||||
case AV_OPT_TYPE_SAMPLE_FMT:*intnum = *(enum AVSampleFormat*)dst;return 0;
|
||||
case AV_OPT_TYPE_INT: *intnum = *(int *)dst;return 0;
|
||||
case AV_OPT_TYPE_CHANNEL_LAYOUT:
|
||||
case AV_OPT_TYPE_DURATION:
|
||||
@@ -110,9 +110,9 @@ static int write_number(void *obj, const AVOption *o, void *dst, double num, int
|
||||
}
|
||||
|
||||
switch (o->type) {
|
||||
case AV_OPT_TYPE_PIXEL_FMT: *(enum AVPixelFormat *)dst = llrint(num/den) * intnum; break;
|
||||
case AV_OPT_TYPE_SAMPLE_FMT:*(enum AVSampleFormat*)dst = llrint(num/den) * intnum; break;
|
||||
case AV_OPT_TYPE_FLAGS:
|
||||
case AV_OPT_TYPE_PIXEL_FMT:
|
||||
case AV_OPT_TYPE_SAMPLE_FMT:
|
||||
case AV_OPT_TYPE_INT: *(int *)dst= llrint(num/den)*intnum; break;
|
||||
case AV_OPT_TYPE_DURATION:
|
||||
case AV_OPT_TYPE_CHANNEL_LAYOUT:
|
||||
@@ -711,6 +711,10 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
|
||||
return AVERROR(EINVAL);
|
||||
if (!(*out_val = av_malloc(len*2 + 1)))
|
||||
return AVERROR(ENOMEM);
|
||||
if (!len) {
|
||||
*out_val[0] = '\0';
|
||||
return 0;
|
||||
}
|
||||
bin = *(uint8_t**)dst;
|
||||
for (i = 0; i < len; i++)
|
||||
snprintf(*out_val + i*2, 3, "%02X", bin[i]);
|
||||
@@ -726,12 +730,14 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
|
||||
break;
|
||||
case AV_OPT_TYPE_DURATION:
|
||||
i64 = *(int64_t *)dst;
|
||||
ret = snprintf(buf, sizeof(buf), "%"PRIi64"d:%02d:%02d.%06d",
|
||||
ret = snprintf(buf, sizeof(buf), "%"PRIi64":%02d:%02d.%06d",
|
||||
i64 / 3600000000, (int)((i64 / 60000000) % 60),
|
||||
(int)((i64 / 1000000) % 60), (int)(i64 % 1000000));
|
||||
break;
|
||||
case AV_OPT_TYPE_COLOR:
|
||||
ret = snprintf(buf, sizeof(buf), "0x%02x%02x%02x%02x", ((int *)dst)[0], ((int *)dst)[1], ((int *)dst)[2], ((int *)dst)[3]);
|
||||
ret = snprintf(buf, sizeof(buf), "0x%02x%02x%02x%02x",
|
||||
(int)((uint8_t *)dst)[0], (int)((uint8_t *)dst)[1],
|
||||
(int)((uint8_t *)dst)[2], (int)((uint8_t *)dst)[3]);
|
||||
break;
|
||||
case AV_OPT_TYPE_CHANNEL_LAYOUT:
|
||||
i64 = *(int64_t *)dst;
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// This header should only be used to simplify code where
|
||||
// threading is optional, not as a generic threading abstraction.
|
||||
|
||||
#ifndef AVUTIL_THREAD_H
|
||||
#define AVUTIL_THREAD_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS
|
||||
|
||||
#if HAVE_PTHREADS
|
||||
#include <pthread.h>
|
||||
#elif HAVE_OS2THREADS
|
||||
#include "compat/os2threads.h"
|
||||
#else
|
||||
#include "compat/w32pthreads.h"
|
||||
#endif
|
||||
|
||||
#define AVMutex pthread_mutex_t
|
||||
|
||||
#define ff_mutex_init pthread_mutex_init
|
||||
#define ff_mutex_lock pthread_mutex_lock
|
||||
#define ff_mutex_unlock pthread_mutex_unlock
|
||||
#define ff_mutex_destroy pthread_mutex_destroy
|
||||
|
||||
#else
|
||||
|
||||
#define AVMutex char
|
||||
|
||||
#define ff_mutex_init(mutex, attr) (0)
|
||||
#define ff_mutex_lock(mutex) (0)
|
||||
#define ff_mutex_unlock(mutex) (0)
|
||||
#define ff_mutex_destroy(mutex) (0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* AVUTIL_THREAD_H */
|
||||
@@ -27,6 +27,9 @@
|
||||
* various utility functions
|
||||
*/
|
||||
|
||||
#include "libavutil/ffversion.h"
|
||||
const char av_util_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||
|
||||
unsigned avutil_version(void)
|
||||
{
|
||||
static int checks_done;
|
||||
|
||||
@@ -89,6 +89,9 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
|
||||
#include "postprocess_internal.h"
|
||||
#include "libavutil/avstring.h"
|
||||
|
||||
#include "libavutil/ffversion.h"
|
||||
const char postproc_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||
|
||||
unsigned postproc_version(void)
|
||||
{
|
||||
av_assert0(LIBPOSTPROC_VERSION_MICRO >= 100);
|
||||
|
||||
@@ -84,14 +84,14 @@ int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFo
|
||||
in_fmt = av_get_packed_sample_fmt( in_fmt);
|
||||
|
||||
if(in_fmt == AV_SAMPLE_FMT_FLT || in_fmt == AV_SAMPLE_FMT_DBL){
|
||||
if(out_fmt == AV_SAMPLE_FMT_S32) scale = 1.0/(1L<<31);
|
||||
if(out_fmt == AV_SAMPLE_FMT_S16) scale = 1.0/(1L<<15);
|
||||
if(out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1.0/(1L<< 7);
|
||||
if(out_fmt == AV_SAMPLE_FMT_S32) scale = 1.0/(1LL<<31);
|
||||
if(out_fmt == AV_SAMPLE_FMT_S16) scale = 1.0/(1LL<<15);
|
||||
if(out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1.0/(1LL<< 7);
|
||||
}
|
||||
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_S32 && (s->dither.output_sample_bits&31)) scale = 1;
|
||||
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_S16) scale = 1L<<16;
|
||||
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1L<<24;
|
||||
if(in_fmt == AV_SAMPLE_FMT_S16 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1L<<8;
|
||||
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_S16) scale = 1<<16;
|
||||
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1<<24;
|
||||
if(in_fmt == AV_SAMPLE_FMT_S16 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1<<8;
|
||||
|
||||
scale *= s->dither.scale;
|
||||
|
||||
|
||||
@@ -76,8 +76,12 @@ static int process(
|
||||
AudioData *src, int src_size, int *consumed){
|
||||
size_t idone, odone;
|
||||
soxr_error_t error = soxr_set_error((soxr_t)c, soxr_set_num_channels((soxr_t)c, src->ch_count));
|
||||
error = soxr_process((soxr_t)c, src->ch, (size_t)src_size,
|
||||
&idone, dst->ch, (size_t)dst_size, &odone);
|
||||
if (!error)
|
||||
error = soxr_process((soxr_t)c, src->ch, (size_t)src_size,
|
||||
&idone, dst->ch, (size_t)dst_size, &odone);
|
||||
else
|
||||
idone = 0;
|
||||
|
||||
*consumed = (int)idone;
|
||||
return error? -1 : odone;
|
||||
}
|
||||
|
||||
@@ -146,6 +146,10 @@ static const AVClass av_class = {
|
||||
.category = AV_CLASS_CATEGORY_SWRESAMPLER,
|
||||
};
|
||||
|
||||
|
||||
#include "libavutil/ffversion.h"
|
||||
const char swr_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||
|
||||
unsigned swresample_version(void)
|
||||
{
|
||||
av_assert0(LIBSWRESAMPLE_VERSION_MICRO >= 100);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
|
||||
|
||||
#define YUVRGB_TABLE_HEADROOM 128
|
||||
#define YUVRGB_TABLE_HEADROOM 256
|
||||
|
||||
#define MAX_FILTER_SIZE 256
|
||||
|
||||
|
||||
+3
-2
@@ -618,14 +618,15 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
|
||||
}
|
||||
|
||||
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
|
||||
for (j = filterSize - 2; j >= 0; j--) {
|
||||
int right = FFMIN(j + shift, filterSize - 1);
|
||||
filter[i * filterSize + right] += filter[i * filterSize + j];
|
||||
filter[i * filterSize + j] = 0;
|
||||
}
|
||||
(*filterPos)[i]= srcW - filterSize;
|
||||
(*filterPos)[i]-= shift;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1623,6 +1623,16 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
|
||||
#define BGR2V_IDX "16*4+16*34"
|
||||
int y;
|
||||
const x86_reg chromWidth= width>>1;
|
||||
|
||||
if (height > 2) {
|
||||
ff_rgb24toyv12_c(src, ydst, udst, vdst, width, 2, lumStride, chromStride, srcStride, rgb2yuv);
|
||||
src += 2*srcStride;
|
||||
ydst += 2*lumStride;
|
||||
udst += chromStride;
|
||||
vdst += chromStride;
|
||||
height -= 2;
|
||||
}
|
||||
|
||||
for (y=0; y<height-2; y+=2) {
|
||||
int 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++) {
|
||||
int w;
|
||||
|
||||
if (width >= 16)
|
||||
#if COMPILE_TEMPLATE_SSE2
|
||||
__asm__(
|
||||
"xor %%"REG_a", %%"REG_a" \n\t"
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data
|
||||
$(M)$< $@
|
||||
|
||||
tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data
|
||||
$(M)$< $(SRC_PATH)/tests/lena.pnm $@
|
||||
$(M)$< $(SAMPLES)/lena.pnm $@
|
||||
|
||||
tests/data/ffprobe-test.nut: ffmpeg$(EXESUF) | tests/data
|
||||
$(M)$(TARGET_EXEC) ./$< \
|
||||
|
||||
@@ -21,7 +21,7 @@ fate-ffmpeg-filter_complex: CMD = framecrc -filter_complex color=d=1:r=5
|
||||
FATE_FFMPEG-$(CONFIG_COLOR_FILTER) += fate-ffmpeg-lavfi
|
||||
fate-ffmpeg-lavfi: CMD = framecrc -lavfi color=d=1:r=5
|
||||
|
||||
FATE_FFMPEG-$(CONFIG_RAWVIDEO_DEMUXER) += fate-force_key_frames
|
||||
FATE_SAMPLES_FFMPEG-$(CONFIG_RAWVIDEO_DEMUXER) += fate-force_key_frames
|
||||
fate-force_key_frames: tests/data/vsynth2.yuv
|
||||
fate-force_key_frames: CMD = enc_dec \
|
||||
"rawvideo -s 352x288 -pix_fmt yuv420p" tests/data/vsynth2.yuv \
|
||||
|
||||
+6
-5
@@ -144,7 +144,7 @@ fate-seek-vsynth2-wmv1: SRC = fate/vsynth2-wmv1.avi
|
||||
fate-seek-vsynth2-wmv2: SRC = fate/vsynth2-wmv2.avi
|
||||
fate-seek-vsynth2-yuv: SRC = fate/vsynth2-yuv.avi
|
||||
|
||||
FATE_SEEK += $(FATE_SEEK_VSYNTH2-yes:%=fate-seek-vsynth2-%)
|
||||
FATE_SAMPLES_SEEK += $(FATE_SEEK_VSYNTH2-yes:%=fate-seek-vsynth2-%)
|
||||
|
||||
# files from fate-lavf
|
||||
|
||||
@@ -226,10 +226,11 @@ fate-seek-lavf-yuv4mpeg: SRC = lavf/lavf.y4m
|
||||
|
||||
FATE_SEEK += $(FATE_SEEK_LAVF-yes:%=fate-seek-lavf-%)
|
||||
|
||||
$(FATE_SEEK): libavformat/seek-test$(EXESUF)
|
||||
$(FATE_SEEK): CMD = run libavformat/seek-test$(EXESUF) $(TARGET_PATH)/tests/data/$(SRC)
|
||||
$(FATE_SEEK): fate-seek-%: fate-%
|
||||
$(FATE_SEEK) $(FATE_SAMPLES_SEEK): libavformat/seek-test$(EXESUF)
|
||||
$(FATE_SEEK) $(FATE_SAMPLES_SEEK): CMD = run libavformat/seek-test$(EXESUF) $(TARGET_PATH)/tests/data/$(SRC)
|
||||
$(FATE_SEEK) $(FATE_SAMPLES_SEEK): fate-seek-%: fate-%
|
||||
fate-seek-%: REF = $(SRC_PATH)/tests/ref/seek/$(@:fate-seek-%=%)
|
||||
|
||||
FATE_AVCONV += $(FATE_SEEK)
|
||||
fate-seek: $(FATE_SEEK)
|
||||
FATE_SAMPLES_AVCONV += $(FATE_SAMPLES_SEEK)
|
||||
fate-seek: $(FATE_SEEK) $(FATE_SAMPLES_SEEK)
|
||||
|
||||
@@ -294,7 +294,8 @@ FATE_VSYNTH2 = $(FATE_VCODEC:%=fate-vsynth2-%)
|
||||
$(FATE_VSYNTH1): tests/data/vsynth1.yuv
|
||||
$(FATE_VSYNTH2): tests/data/vsynth2.yuv
|
||||
|
||||
FATE_AVCONV += $(FATE_VSYNTH1) $(FATE_VSYNTH2)
|
||||
FATE_AVCONV += $(FATE_VSYNTH1)
|
||||
FATE_SAMPLES_AVCONV += $(FATE_VSYNTH2)
|
||||
|
||||
fate-vsynth1: $(FATE_VSYNTH1)
|
||||
fate-vsynth2: $(FATE_VSYNTH2)
|
||||
|
||||
-109
File diff suppressed because one or more lines are too long
@@ -1,16 +1,16 @@
|
||||
#tb 0: 1/25
|
||||
#tb 0: 1/50
|
||||
0, 0, 0, 1, 152064, 0x05b789ef
|
||||
0, 1, 1, 1, 152064, 0x05b789ef
|
||||
0, 2, 2, 1, 152064, 0x4bb46551
|
||||
0, 3, 3, 1, 152064, 0x9dddf64a
|
||||
0, 4, 4, 1, 152064, 0x2a8380b0
|
||||
0, 5, 5, 1, 152064, 0x4de3b652
|
||||
0, 6, 6, 1, 152064, 0xedb5a8e6
|
||||
0, 7, 7, 1, 152064, 0xe20f7c23
|
||||
0, 8, 8, 1, 152064, 0x5ab58bac
|
||||
0, 9, 9, 1, 152064, 0x1f1b8026
|
||||
0, 10, 10, 1, 152064, 0x91373915
|
||||
0, 11, 11, 1, 152064, 0x02344760
|
||||
0, 12, 12, 1, 152064, 0x30f5fcd5
|
||||
0, 13, 13, 1, 152064, 0xc711ad61
|
||||
0, 14, 14, 1, 152064, 0x24eca223
|
||||
0, 3, 3, 1, 152064, 0x4bb46551
|
||||
0, 4, 4, 1, 152064, 0x9dddf64a
|
||||
0, 5, 5, 1, 152064, 0x9dddf64a
|
||||
0, 6, 6, 1, 152064, 0x2a8380b0
|
||||
0, 7, 7, 1, 152064, 0x2a8380b0
|
||||
0, 8, 8, 1, 152064, 0x4de3b652
|
||||
0, 9, 9, 1, 152064, 0x4de3b652
|
||||
0, 10, 10, 1, 152064, 0xedb5a8e6
|
||||
0, 11, 11, 1, 152064, 0xedb5a8e6
|
||||
0, 12, 12, 1, 152064, 0xe20f7c23
|
||||
0, 13, 13, 1, 152064, 0xe20f7c23
|
||||
0, 14, 14, 1, 152064, 0x5ab58bac
|
||||
|
||||
@@ -35,15 +35,15 @@
|
||||
0, 330, 330, 1, 4295, 0xf71b0b38, S=1, 1024, 0xf351799f
|
||||
0, 340, 340, 1, 2044, 0x5adcb93b, S=1, 1024, 0xf351799f
|
||||
0, 350, 350, 1, 3212, 0xcf79eeed, S=1, 1024, 0xf351799f
|
||||
0, 360, 360, 1, 2281, 0x68464d30, S=1, 1024, 0xf351799f
|
||||
0, 360, 360, 1, 2292, 0xb4386334, S=1, 1024, 0xf351799f
|
||||
0, 370, 370, 1, 3633, 0x0010992f, S=1, 1024, 0xf351799f
|
||||
0, 380, 380, 1, 3552, 0x23697490, S=1, 1024, 0xf351799f
|
||||
0, 390, 390, 1, 3690, 0x62afdbb8, S=1, 1024, 0xf351799f
|
||||
0, 400, 400, 1, 1558, 0x7a13e53b, S=1, 1024, 0xf351799f
|
||||
0, 410, 410, 1, 940, 0xb1b6cba2, S=1, 1024, 0xf351799f
|
||||
0, 400, 400, 1, 1559, 0x5baef54a, S=1, 1024, 0xf351799f
|
||||
0, 410, 410, 1, 954, 0xca75ca79, S=1, 1024, 0xf351799f
|
||||
0, 420, 420, 1, 273, 0x3687799b, S=1, 1024, 0xf351799f
|
||||
0, 430, 430, 1, 930, 0x29f3b0c4, S=1, 1024, 0xf351799f
|
||||
0, 440, 440, 1, 271, 0xe7af807c, S=1, 1024, 0xf351799f
|
||||
0, 440, 440, 1, 271, 0x305e8094, S=1, 1024, 0xf351799f
|
||||
0, 450, 450, 1, 196, 0xf5ab51ee, S=1, 1024, 0xf351799f
|
||||
0, 460, 460, 1, 4299, 0x67ec0d55, S=1, 1024, 0xf351799f
|
||||
0, 470, 470, 1, 4895, 0xb394406c, S=1, 1024, 0xf351799f
|
||||
@@ -56,7 +56,7 @@
|
||||
0, 540, 540, 1, 5179, 0x860fc6a1, S=1, 1024, 0xf351799f
|
||||
0, 550, 550, 1, 5046, 0xce9183d3, S=1, 1024, 0xf351799f
|
||||
0, 560, 560, 1, 5140, 0xa6d7b9af, S=1, 1024, 0xf351799f
|
||||
0, 570, 570, 1, 4289, 0xb415f717, S=1, 1024, 0xf351799f
|
||||
0, 570, 570, 1, 4301, 0x03b6ef3f, S=1, 1024, 0xf351799f
|
||||
0, 580, 580, 1, 5079, 0xa8d59e01, S=1, 1024, 0xf351799f
|
||||
0, 590, 590, 1, 5284, 0xea34e3b3, S=1, 1024, 0xf351799f
|
||||
0, 600, 600, 1, 5426, 0x556a15cd, S=1, 1024, 0xf351799f
|
||||
|
||||
@@ -35,15 +35,15 @@
|
||||
0, 330, 330, 1, 4295, 0xc1850a80, S=1, 1024, 0xcfc8799f
|
||||
0, 340, 340, 1, 2044, 0x0440c072, S=1, 1024, 0xcfc8799f
|
||||
0, 350, 350, 1, 3212, 0xe91af08f, S=1, 1024, 0xcfc8799f
|
||||
0, 360, 360, 1, 2281, 0x6a414aa1, S=1, 1024, 0xcfc8799f
|
||||
0, 360, 360, 1, 2292, 0x6765633e, S=1, 1024, 0xcfc8799f
|
||||
0, 370, 370, 1, 3633, 0xac779aa3, S=1, 1024, 0xcfc8799f
|
||||
0, 380, 380, 1, 3552, 0xed2c75b2, S=1, 1024, 0xcfc8799f
|
||||
0, 390, 390, 1, 3690, 0x2020dd0d, S=1, 1024, 0xcfc8799f
|
||||
0, 400, 400, 1, 1558, 0x2c14e4b2, S=1, 1024, 0xcfc8799f
|
||||
0, 410, 410, 1, 940, 0x4927cd90, S=1, 1024, 0xcfc8799f
|
||||
0, 400, 400, 1, 1559, 0x596ef330, S=1, 1024, 0xcfc8799f
|
||||
0, 410, 410, 1, 954, 0xac12c9c5, S=1, 1024, 0xcfc8799f
|
||||
0, 420, 420, 1, 273, 0x138c7831, S=1, 1024, 0xcfc8799f
|
||||
0, 430, 430, 1, 930, 0xf1c3ae3f, S=1, 1024, 0xcfc8799f
|
||||
0, 440, 440, 1, 271, 0x6d338044, S=1, 1024, 0xcfc8799f
|
||||
0, 440, 440, 1, 271, 0x921a80af, S=1, 1024, 0xcfc8799f
|
||||
0, 450, 450, 1, 196, 0xa5de5322, S=1, 1024, 0xcfc8799f
|
||||
0, 460, 460, 1, 4299, 0x5bac0d86, S=1, 1024, 0xcfc8799f
|
||||
0, 470, 470, 1, 4895, 0xc43639a6, S=1, 1024, 0xcfc8799f
|
||||
@@ -56,7 +56,7 @@
|
||||
0, 540, 540, 1, 5179, 0x97aac3a1, S=1, 1024, 0xcfc8799f
|
||||
0, 550, 550, 1, 5046, 0x836a80cd, S=1, 1024, 0xcfc8799f
|
||||
0, 560, 560, 1, 5140, 0xa725c1e7, S=1, 1024, 0xcfc8799f
|
||||
0, 570, 570, 1, 4289, 0x7b3afbc0, S=1, 1024, 0xcfc8799f
|
||||
0, 570, 570, 1, 4301, 0x0203f239, S=1, 1024, 0xcfc8799f
|
||||
0, 580, 580, 1, 5079, 0xb2e7a2de, S=1, 1024, 0xcfc8799f
|
||||
0, 590, 590, 1, 5284, 0xb757dfe1, S=1, 1024, 0xcfc8799f
|
||||
0, 600, 600, 1, 5426, 0xf9f11e57, S=1, 1024, 0xcfc8799f
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user