Compare commits
14 Commits
n2.0.7
...
release/2.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
72006016ae | ||
![]() |
f23efdd240 | ||
![]() |
2789b48b4e | ||
![]() |
5628d62022 | ||
![]() |
58986f0fa1 | ||
![]() |
c513e721f3 | ||
![]() |
087561a7dc | ||
![]() |
0b0183c5b7 | ||
![]() |
055c302a11 | ||
![]() |
b44025a1d0 | ||
![]() |
7fc8458beb | ||
![]() |
9b493887d5 | ||
![]() |
804b90a5f5 | ||
![]() |
4a2be7027f |
@@ -14,7 +14,6 @@ patches and related discussions.
|
|||||||
Project Leader
|
Project Leader
|
||||||
==============
|
==============
|
||||||
|
|
||||||
Michael Niedermayer
|
|
||||||
final design decisions
|
final design decisions
|
||||||
|
|
||||||
|
|
||||||
|
@@ -3370,7 +3370,7 @@ within the parameter list.
|
|||||||
@item
|
@item
|
||||||
Show the text at the center of the video frame:
|
Show the text at the center of the video frame:
|
||||||
@example
|
@example
|
||||||
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
|
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@item
|
@item
|
||||||
|
@@ -386,7 +386,7 @@ Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
|
|||||||
Return the maximum between @var{x} and @var{y}.
|
Return the maximum between @var{x} and @var{y}.
|
||||||
|
|
||||||
@item min(x, y)
|
@item min(x, y)
|
||||||
Return the maximum between @var{x} and @var{y}.
|
Return the minimum between @var{x} and @var{y}.
|
||||||
|
|
||||||
@item mod(x, y)
|
@item mod(x, y)
|
||||||
Compute the remainder of division of @var{x} by @var{y}.
|
Compute the remainder of division of @var{x} by @var{y}.
|
||||||
|
@@ -102,7 +102,7 @@ av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
|
|||||||
av_cold int ffv1_init_slices_state(FFV1Context *f)
|
av_cold int ffv1_init_slices_state(FFV1Context *f)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
for (i = 0; i < f->slice_count; i++) {
|
for (i = 0; i < f->max_slice_count; i++) {
|
||||||
FFV1Context *fs = f->slice_context[i];
|
FFV1Context *fs = f->slice_context[i];
|
||||||
if ((ret = ffv1_init_slice_state(f, fs)) < 0)
|
if ((ret = ffv1_init_slice_state(f, fs)) < 0)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
@@ -114,10 +114,10 @@ av_cold int ffv1_init_slice_contexts(FFV1Context *f)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
f->slice_count = f->num_h_slices * f->num_v_slices;
|
f->max_slice_count = f->num_h_slices * f->num_v_slices;
|
||||||
av_assert0(f->slice_count > 0);
|
av_assert0(f->max_slice_count > 0);
|
||||||
|
|
||||||
for (i = 0; i < f->slice_count; i++) {
|
for (i = 0; i < f->max_slice_count; i++) {
|
||||||
FFV1Context *fs = av_mallocz(sizeof(*fs));
|
FFV1Context *fs = av_mallocz(sizeof(*fs));
|
||||||
int sx = i % f->num_h_slices;
|
int sx = i % f->num_h_slices;
|
||||||
int sy = i / f->num_h_slices;
|
int sy = i / f->num_h_slices;
|
||||||
@@ -202,7 +202,7 @@ av_cold int ffv1_close(AVCodecContext *avctx)
|
|||||||
ff_thread_release_buffer(avctx, &s->last_picture);
|
ff_thread_release_buffer(avctx, &s->last_picture);
|
||||||
av_frame_free(&s->last_picture.f);
|
av_frame_free(&s->last_picture.f);
|
||||||
|
|
||||||
for (j = 0; j < s->slice_count; j++) {
|
for (j = 0; j < s->max_slice_count; j++) {
|
||||||
FFV1Context *fs = s->slice_context[j];
|
FFV1Context *fs = s->slice_context[j];
|
||||||
for (i = 0; i < s->plane_count; i++) {
|
for (i = 0; i < s->plane_count; i++) {
|
||||||
PlaneContext *p = &fs->plane[i];
|
PlaneContext *p = &fs->plane[i];
|
||||||
@@ -216,14 +216,14 @@ av_cold int ffv1_close(AVCodecContext *avctx)
|
|||||||
av_freep(&avctx->stats_out);
|
av_freep(&avctx->stats_out);
|
||||||
for (j = 0; j < s->quant_table_count; j++) {
|
for (j = 0; j < s->quant_table_count; j++) {
|
||||||
av_freep(&s->initial_states[j]);
|
av_freep(&s->initial_states[j]);
|
||||||
for (i = 0; i < s->slice_count; i++) {
|
for (i = 0; i < s->max_slice_count; i++) {
|
||||||
FFV1Context *sf = s->slice_context[i];
|
FFV1Context *sf = s->slice_context[i];
|
||||||
av_freep(&sf->rc_stat2[j]);
|
av_freep(&sf->rc_stat2[j]);
|
||||||
}
|
}
|
||||||
av_freep(&s->rc_stat2[j]);
|
av_freep(&s->rc_stat2[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < s->slice_count; i++)
|
for (i = 0; i < s->max_slice_count; i++)
|
||||||
av_freep(&s->slice_context[i]);
|
av_freep(&s->slice_context[i]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -122,6 +122,7 @@ typedef struct FFV1Context {
|
|||||||
|
|
||||||
struct FFV1Context *slice_context[MAX_SLICES];
|
struct FFV1Context *slice_context[MAX_SLICES];
|
||||||
int slice_count;
|
int slice_count;
|
||||||
|
int max_slice_count;
|
||||||
int num_v_slices;
|
int num_v_slices;
|
||||||
int num_h_slices;
|
int num_h_slices;
|
||||||
int slice_width;
|
int slice_width;
|
||||||
|
@@ -521,8 +521,11 @@ static int read_extra_header(FFV1Context *f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
f->quant_table_count = get_symbol(c, state, 0);
|
f->quant_table_count = get_symbol(c, state, 0);
|
||||||
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES)
|
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count) {
|
||||||
|
av_log(f->avctx, AV_LOG_ERROR, "quant table count %d is invalid\n", f->quant_table_count);
|
||||||
|
f->quant_table_count = 0;
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < f->quant_table_count; i++) {
|
for (i = 0; i < f->quant_table_count; i++) {
|
||||||
f->context_count[i] = read_quant_tables(c, f->quant_tables[i]);
|
f->context_count[i] = read_quant_tables(c, f->quant_tables[i]);
|
||||||
@@ -696,6 +699,7 @@ static int read_header(FFV1Context *f)
|
|||||||
av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
|
av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
f->slice_count = f->max_slice_count;
|
||||||
} else if (f->version < 3) {
|
} else if (f->version < 3) {
|
||||||
f->slice_count = get_symbol(c, state, 0);
|
f->slice_count = get_symbol(c, state, 0);
|
||||||
} else {
|
} else {
|
||||||
@@ -710,8 +714,8 @@ static int read_header(FFV1Context *f)
|
|||||||
p -= size + trailer;
|
p -= size + trailer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0) {
|
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0 || f->slice_count > f->max_slice_count) {
|
||||||
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid\n", f->slice_count);
|
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid (max=%d)\n", f->slice_count, f->max_slice_count);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -927,6 +931,7 @@ static int init_thread_copy(AVCodecContext *avctx)
|
|||||||
f->picture.f = NULL;
|
f->picture.f = NULL;
|
||||||
f->last_picture.f = NULL;
|
f->last_picture.f = NULL;
|
||||||
f->sample_buffer = NULL;
|
f->sample_buffer = NULL;
|
||||||
|
f->max_slice_count = 0;
|
||||||
f->slice_count = 0;
|
f->slice_count = 0;
|
||||||
|
|
||||||
for (i = 0; i < f->quant_table_count; i++) {
|
for (i = 0; i < f->quant_table_count; i++) {
|
||||||
@@ -997,7 +1002,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
|
|||||||
av_assert0(!fdst->sample_buffer);
|
av_assert0(!fdst->sample_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
av_assert1(fdst->slice_count == fsrc->slice_count);
|
av_assert1(fdst->max_slice_count == fsrc->max_slice_count);
|
||||||
|
|
||||||
|
|
||||||
ff_thread_release_buffer(dst, &fdst->picture);
|
ff_thread_release_buffer(dst, &fdst->picture);
|
||||||
|
@@ -902,6 +902,7 @@ slices_ok:
|
|||||||
|
|
||||||
if ((ret = ffv1_init_slice_contexts(s)) < 0)
|
if ((ret = ffv1_init_slice_contexts(s)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
s->slice_count = s->max_slice_count;
|
||||||
if ((ret = ffv1_init_slices_state(s)) < 0)
|
if ((ret = ffv1_init_slices_state(s)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -911,7 +912,7 @@ slices_ok:
|
|||||||
if (!avctx->stats_out)
|
if (!avctx->stats_out)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
for (i = 0; i < s->quant_table_count; i++)
|
for (i = 0; i < s->quant_table_count; i++)
|
||||||
for (j = 0; j < s->slice_count; j++) {
|
for (j = 0; j < s->max_slice_count; j++) {
|
||||||
FFV1Context *sf = s->slice_context[j];
|
FFV1Context *sf = s->slice_context[j];
|
||||||
av_assert0(!sf->rc_stat2[i]);
|
av_assert0(!sf->rc_stat2[i]);
|
||||||
sf->rc_stat2[i] = av_mallocz(s->context_count[i] *
|
sf->rc_stat2[i] = av_mallocz(s->context_count[i] *
|
||||||
|
@@ -168,7 +168,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
|
|||||||
buf += ctx->length_size;
|
buf += ctx->length_size;
|
||||||
unit_type = *buf & 0x1f;
|
unit_type = *buf & 0x1f;
|
||||||
|
|
||||||
if (buf + nal_size > buf_end || nal_size < 0)
|
if (nal_size > buf_end - buf || nal_size < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
/* prepend only to the first type 5 NAL unit of an IDR picture */
|
/* prepend only to the first type 5 NAL unit of an IDR picture */
|
||||||
|
@@ -1667,9 +1667,11 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr,
|
|||||||
uint32_t header;
|
uint32_t header;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
int skipped = 0;
|
||||||
while(buf_size && !*buf){
|
while(buf_size && !*buf){
|
||||||
buf++;
|
buf++;
|
||||||
buf_size--;
|
buf_size--;
|
||||||
|
skipped++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf_size < HEADER_SIZE)
|
if (buf_size < HEADER_SIZE)
|
||||||
@@ -1724,7 +1726,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
s->frame_size = 0;
|
s->frame_size = 0;
|
||||||
return buf_size;
|
return buf_size + skipped;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mp_flush(MPADecodeContext *ctx)
|
static void mp_flush(MPADecodeContext *ctx)
|
||||||
|
@@ -27,8 +27,8 @@ SECTION .text
|
|||||||
%if lut_bits != 8
|
%if lut_bits != 8
|
||||||
sar %1q, 8-lut_bits
|
sar %1q, 8-lut_bits
|
||||||
%endif
|
%endif
|
||||||
movsx %1d, word [%3q+%1q*2]
|
movsx %1q, word [%3q+%1q*2]
|
||||||
add %1d, %2d
|
add %1q, %2q
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
%macro LOAD 3 ; dstreg, x, bitdepth
|
%macro LOAD 3 ; dstreg, x, bitdepth
|
||||||
|
@@ -1330,7 +1330,8 @@ static int avi_read_idx1(AVFormatContext *s, int size)
|
|||||||
ast = st->priv_data;
|
ast = st->priv_data;
|
||||||
|
|
||||||
if (first_packet && first_packet_pos) {
|
if (first_packet && first_packet_pos) {
|
||||||
data_offset = first_packet_pos - pos;
|
if (avi->movi_list + 4 != pos || pos + 500 > first_packet_pos)
|
||||||
|
data_offset = first_packet_pos - pos;
|
||||||
first_packet = 0;
|
first_packet = 0;
|
||||||
}
|
}
|
||||||
pos += data_offset;
|
pos += data_offset;
|
||||||
|
@@ -256,7 +256,7 @@ static int ogg_buffer_data(AVFormatContext *s, AVStream *st,
|
|||||||
if (i == total_segments)
|
if (i == total_segments)
|
||||||
page->granule = granule;
|
page->granule = granule;
|
||||||
|
|
||||||
if (!header) {
|
{
|
||||||
AVStream *st = s->streams[page->stream_index];
|
AVStream *st = s->streams[page->stream_index];
|
||||||
|
|
||||||
int64_t start = av_rescale_q(page->start_granule, st->time_base,
|
int64_t start = av_rescale_q(page->start_granule, st->time_base,
|
||||||
@@ -264,10 +264,13 @@ static int ogg_buffer_data(AVFormatContext *s, AVStream *st,
|
|||||||
int64_t next = av_rescale_q(page->granule, st->time_base,
|
int64_t next = av_rescale_q(page->granule, st->time_base,
|
||||||
AV_TIME_BASE_Q);
|
AV_TIME_BASE_Q);
|
||||||
|
|
||||||
if (page->segments_count == 255 ||
|
if (page->segments_count == 255) {
|
||||||
(ogg->pref_size > 0 && page->size >= ogg->pref_size) ||
|
|
||||||
(ogg->pref_duration > 0 && next - start >= ogg->pref_duration)) {
|
|
||||||
ogg_buffer_page(s, oggstream);
|
ogg_buffer_page(s, oggstream);
|
||||||
|
} else if (!header) {
|
||||||
|
if ((ogg->pref_size > 0 && page->size >= ogg->pref_size) ||
|
||||||
|
(ogg->pref_duration > 0 && next - start >= ogg->pref_duration)) {
|
||||||
|
ogg_buffer_page(s, oggstream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -384,10 +384,8 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
}
|
}
|
||||||
if (st->codec->pix_fmt != AV_PIX_FMT_NONE && st->codec->pix_fmt != pix_fmt) {
|
if (st->codec->pix_fmt != AV_PIX_FMT_NONE && st->codec->pix_fmt != pix_fmt) {
|
||||||
av_log(s, AV_LOG_ERROR, "pixel format change unsupported\n");
|
av_log(s, AV_LOG_ERROR, "pixel format change unsupported\n");
|
||||||
res = AVERROR_PATCHWELCOME;
|
}else
|
||||||
goto bitmap_end;
|
st->codec->pix_fmt = pix_fmt;
|
||||||
}
|
|
||||||
st->codec->pix_fmt = pix_fmt;
|
|
||||||
|
|
||||||
if (linesize * height > pkt->size) {
|
if (linesize * height > pkt->size) {
|
||||||
res = AVERROR_INVALIDDATA;
|
res = AVERROR_INVALIDDATA;
|
||||||
|
@@ -1874,8 +1874,10 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui
|
|||||||
for (h=0; h < height; h++) {
|
for (h=0; h < height; h++) {
|
||||||
int w;
|
int w;
|
||||||
|
|
||||||
if (width >= 16)
|
if (width >= 16
|
||||||
#if COMPILE_TEMPLATE_SSE2
|
#if COMPILE_TEMPLATE_SSE2
|
||||||
|
&& !((((intptr_t)src1) | ((intptr_t)src2) | ((intptr_t)dest))&15)
|
||||||
|
)
|
||||||
__asm__(
|
__asm__(
|
||||||
"xor %%"REG_a", %%"REG_a" \n\t"
|
"xor %%"REG_a", %%"REG_a" \n\t"
|
||||||
"1: \n\t"
|
"1: \n\t"
|
||||||
@@ -1895,6 +1897,7 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui
|
|||||||
: "memory", "%"REG_a""
|
: "memory", "%"REG_a""
|
||||||
);
|
);
|
||||||
#else
|
#else
|
||||||
|
)
|
||||||
__asm__(
|
__asm__(
|
||||||
"xor %%"REG_a", %%"REG_a" \n\t"
|
"xor %%"REG_a", %%"REG_a" \n\t"
|
||||||
"1: \n\t"
|
"1: \n\t"
|
||||||
|
Reference in New Issue
Block a user