Compare commits
32 Commits
n3.0.2
...
release/3.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b62191f9c1 | ||
![]() |
21c36d83f8 | ||
![]() |
4774eb8128 | ||
![]() |
96f5019bde | ||
![]() |
bffe1c4222 | ||
![]() |
fbdf5ca763 | ||
![]() |
c6470d8193 | ||
![]() |
e5942c1436 | ||
![]() |
dab82a2a7c | ||
![]() |
7f864badc0 | ||
![]() |
cc1e01d8b6 | ||
![]() |
69c3dfdd54 | ||
![]() |
241f1e603f | ||
![]() |
4d9fdca053 | ||
![]() |
b11900251f | ||
![]() |
145b18ce9a | ||
![]() |
e5d167149d | ||
![]() |
ed71759fd0 | ||
![]() |
d7ae13d479 | ||
![]() |
1cd872a7d5 | ||
![]() |
f6586db165 | ||
![]() |
7c43c48fda | ||
![]() |
069eea16d9 | ||
![]() |
79181b97d4 | ||
![]() |
46360e36d9 | ||
![]() |
ef2b8416d9 | ||
![]() |
9491f47035 | ||
![]() |
2fc7e5c1b5 | ||
![]() |
68dcb46205 | ||
![]() |
8dce66d33d | ||
![]() |
08c21bcb5d | ||
![]() |
e675926a4f |
6
configure
vendored
6
configure
vendored
@@ -5923,11 +5923,7 @@ elif enabled ccc; then
|
||||
add_cflags -msg_disable nonstandcast
|
||||
add_cflags -msg_disable unsupieee
|
||||
elif enabled gcc; then
|
||||
case $gcc_basever in
|
||||
4.9*) enabled x86 || check_optflags -fno-tree-vectorize ;;
|
||||
4.*) check_optflags -fno-tree-vectorize ;;
|
||||
*) enabled x86 || check_optflags -fno-tree-vectorize ;;
|
||||
esac
|
||||
check_optflags -fno-tree-vectorize
|
||||
check_cflags -Werror=format-security
|
||||
check_cflags -Werror=implicit-function-declaration
|
||||
check_cflags -Werror=missing-prototypes
|
||||
|
@@ -403,6 +403,35 @@ finding a new maintainer and also don't forget to update the @file{MAINTAINERS}
|
||||
|
||||
We think our rules are not too hard. If you have comments, contact us.
|
||||
|
||||
@section Code of conduct
|
||||
|
||||
Be friendly and respectful towards others and third parties.
|
||||
Treat others the way you yourself want to be treated.
|
||||
|
||||
Be considerate. Not everyone shares the same viewpoint and priorities as you do.
|
||||
Different opinions and interpretations help the project.
|
||||
Looking at issues from a different perspective assists development.
|
||||
|
||||
Do not assume malice for things that can be attributed to incompetence. Even if
|
||||
it is malice, it's rarely good to start with that as initial assumption.
|
||||
|
||||
Stay friendly even if someone acts contrarily. Everyone has a bad day
|
||||
once in a while.
|
||||
If you yourself have a bad day or are angry then try to take a break and reply
|
||||
once you are calm and without anger if you have to.
|
||||
|
||||
Try to help other team members and cooperate if you can.
|
||||
|
||||
The goal of software development is to create technical excellence, not for any
|
||||
individual to be better and "win" against the others. Large software projects
|
||||
are only possible and successful through teamwork.
|
||||
|
||||
If someone struggles do not put them down. Give them a helping hand
|
||||
instead and point them in the right direction.
|
||||
|
||||
Finally, keep in mind the immortal words of Bill and Ted,
|
||||
"Be excellent to each other."
|
||||
|
||||
@anchor{Submitting patches}
|
||||
@section Submitting patches
|
||||
|
||||
|
@@ -950,7 +950,7 @@ following image formats are supported:
|
||||
@item COOK @tab @tab X
|
||||
@tab All versions except 5.1 are supported.
|
||||
@item DCA (DTS Coherent Acoustics) @tab X @tab X
|
||||
@tab supported extensions: XCh, XLL (partially)
|
||||
@tab supported extensions: XCh, XXCH, X96, XBR, XLL
|
||||
@item DPCM id RoQ @tab X @tab X
|
||||
@tab Used in Quake III, Jedi Knight 2 and other computer games.
|
||||
@item DPCM Interplay @tab @tab X
|
||||
|
3
ffmpeg.c
3
ffmpeg.c
@@ -2893,7 +2893,8 @@ static int transcode_init(void)
|
||||
* overhead
|
||||
*/
|
||||
if(!strcmp(oc->oformat->name, "avi")) {
|
||||
if ( copy_tb<0 && av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
|
||||
if ( copy_tb<0 && ist->st->r_frame_rate.num
|
||||
&& av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
|
||||
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(ist->st->time_base)
|
||||
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(dec_ctx->time_base)
|
||||
&& av_q2d(ist->st->time_base) < 1.0/500 && av_q2d(dec_ctx->time_base) < 1.0/500
|
||||
|
2
ffplay.c
2
ffplay.c
@@ -2730,7 +2730,7 @@ static int stream_component_open(VideoState *is, int stream_index)
|
||||
goto fail;
|
||||
link = is->out_audio_filter->inputs[0];
|
||||
sample_rate = link->sample_rate;
|
||||
nb_channels = link->channels;
|
||||
nb_channels = avfilter_link_get_channels(link);
|
||||
channel_layout = link->channel_layout;
|
||||
}
|
||||
#else
|
||||
|
@@ -3858,6 +3858,8 @@ drop:
|
||||
if (avformat_write_header(s, NULL) < 0) {
|
||||
http_log("Container doesn't support the required parameters\n");
|
||||
avio_closep(&s->pb);
|
||||
s->streams = NULL;
|
||||
s->nb_streams = 0;
|
||||
avformat_free_context(s);
|
||||
goto bail;
|
||||
}
|
||||
|
@@ -67,6 +67,8 @@ restart:
|
||||
|
||||
if (bpc->pc.index + i > 17) {
|
||||
next = i - 17;
|
||||
state = 0;
|
||||
break;
|
||||
} else
|
||||
goto restart;
|
||||
} else if (bpc->pc.frame_start_found)
|
||||
|
@@ -1900,9 +1900,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->xch_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "XCH sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1922,9 +1923,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->x96_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "X96 sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1947,9 +1949,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->xxch_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "XXCH sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -903,8 +903,8 @@ static int decode_lowdelay(DiracContext *s)
|
||||
} else {
|
||||
for (slice_y = 0; bufsize > 0 && slice_y < s->num_y; slice_y++) {
|
||||
for (slice_x = 0; bufsize > 0 && slice_x < s->num_x; slice_x++) {
|
||||
bytes = (slice_num+1) * s->lowdelay.bytes.num / s->lowdelay.bytes.den
|
||||
- slice_num * s->lowdelay.bytes.num / s->lowdelay.bytes.den;
|
||||
bytes = (slice_num+1) * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den
|
||||
- slice_num * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den;
|
||||
slices[slice_num].bytes = bytes;
|
||||
slices[slice_num].slice_x = slice_x;
|
||||
slices[slice_num].slice_y = slice_y;
|
||||
|
@@ -3149,6 +3149,8 @@ static av_cold int hevc_init_context(AVCodecContext *avctx)
|
||||
s->context_initialized = 1;
|
||||
s->eos = 0;
|
||||
|
||||
ff_hevc_reset_sei(s);
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
@@ -1092,6 +1092,15 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
|
||||
int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
|
||||
uint8_t *buf, int buf_size);
|
||||
|
||||
/**
|
||||
* Reset SEI values that are stored on the Context.
|
||||
* e.g. Caption data that was extracted during NAL
|
||||
* parsing.
|
||||
*
|
||||
* @param s HEVCContext.
|
||||
*/
|
||||
void ff_hevc_reset_sei(HEVCContext *s);
|
||||
|
||||
extern const uint8_t ff_hevc_qpel_extra_before[4];
|
||||
extern const uint8_t ff_hevc_qpel_extra_after[4];
|
||||
extern const uint8_t ff_hevc_qpel_extra[4];
|
||||
|
@@ -209,6 +209,8 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
|
||||
|
||||
h->avctx = avctx;
|
||||
|
||||
ff_hevc_reset_sei(h);
|
||||
|
||||
if (!buf_size)
|
||||
return 0;
|
||||
|
||||
|
@@ -373,3 +373,9 @@ int ff_hevc_decode_nal_sei(HEVCContext *s)
|
||||
} while (more_rbsp_data(&s->HEVClc->gb));
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ff_hevc_reset_sei(HEVCContext *s)
|
||||
{
|
||||
s->a53_caption_size = 0;
|
||||
av_freep(&s->a53_caption);
|
||||
}
|
||||
|
@@ -352,6 +352,12 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
|
||||
ctx->enc_params.cp_cinema = ctx->cinema_mode;
|
||||
#endif
|
||||
|
||||
if (!ctx->numresolution) {
|
||||
ctx->numresolution = 6;
|
||||
while (FFMIN(avctx->width, avctx->height) >> ctx->numresolution < 1)
|
||||
ctx->numresolution --;
|
||||
}
|
||||
|
||||
ctx->enc_params.mode = !!avctx->global_quality;
|
||||
ctx->enc_params.prog_order = ctx->prog_order;
|
||||
ctx->enc_params.numresolution = ctx->numresolution;
|
||||
@@ -814,7 +820,7 @@ static const AVOption options[] = {
|
||||
{ "rpcl", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = OPJ(RPCL) }, 0, 0, VE, "prog_order" },
|
||||
{ "pcrl", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = OPJ(PCRL) }, 0, 0, VE, "prog_order" },
|
||||
{ "cprl", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = OPJ(CPRL) }, 0, 0, VE, "prog_order" },
|
||||
{ "numresolution", NULL, OFFSET(numresolution), AV_OPT_TYPE_INT, { .i64 = 6 }, 1, INT_MAX, VE },
|
||||
{ "numresolution", NULL, OFFSET(numresolution), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
|
||||
{ "numlayers", NULL, OFFSET(numlayers), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 10, VE },
|
||||
{ "disto_alloc", NULL, OFFSET(disto_alloc), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
|
||||
{ "fixed_alloc", NULL, OFFSET(fixed_alloc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
|
||||
|
@@ -1369,11 +1369,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
int mb_x, mb_y;
|
||||
int EOBRUN = 0;
|
||||
int c = s->comp_index[0];
|
||||
uint8_t *data = s->picture_ptr->data[c];
|
||||
int linesize = s->linesize[c];
|
||||
int last_scan = 0;
|
||||
int16_t *quant_matrix = s->quant_matrixes[s->quant_sindex[0]];
|
||||
int bytes_per_pixel = 1 + (s->bits > 8);
|
||||
|
||||
av_assert0(ss>=0 && Ah>=0 && Al>=0);
|
||||
if (se < ss || se > 63) {
|
||||
@@ -1384,15 +1380,10 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
// s->coefs_finished is a bitmask for coefficients coded
|
||||
// ss and se are parameters telling start and end coefficients
|
||||
s->coefs_finished[c] |= (2ULL << se) - (1ULL << ss);
|
||||
last_scan = !Al && !~s->coefs_finished[c];
|
||||
|
||||
if (s->interlaced && s->bottom_field)
|
||||
data += linesize >> 1;
|
||||
|
||||
s->restart_count = 0;
|
||||
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
|
||||
uint8_t *ptr = data + (mb_y * linesize * 8 >> s->avctx->lowres);
|
||||
int block_idx = mb_y * s->block_stride[c];
|
||||
int16_t (*block)[64] = &s->blocks[c][block_idx];
|
||||
uint8_t *last_nnz = &s->last_nnz[c][block_idx];
|
||||
@@ -1413,12 +1404,6 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (last_scan) {
|
||||
s->idsp.idct_put(ptr, linesize, *block);
|
||||
if (s->bits & 7)
|
||||
shift_output(s, ptr, linesize);
|
||||
ptr += bytes_per_pixel*8 >> s->avctx->lowres;
|
||||
}
|
||||
if (handle_rstn(s, 0))
|
||||
EOBRUN = 0;
|
||||
}
|
||||
@@ -1426,6 +1411,41 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mjpeg_idct_scan_progressive_ac(MJpegDecodeContext *s)
|
||||
{
|
||||
int mb_x, mb_y;
|
||||
int c;
|
||||
const int bytes_per_pixel = 1 + (s->bits > 8);
|
||||
const int block_size = s->lossless ? 1 : 8;
|
||||
|
||||
for (c = 0; c < s->nb_components; c++) {
|
||||
uint8_t *data = s->picture_ptr->data[c];
|
||||
int linesize = s->linesize[c];
|
||||
int h = s->h_max / s->h_count[c];
|
||||
int v = s->v_max / s->v_count[c];
|
||||
int mb_width = (s->width + h * block_size - 1) / (h * block_size);
|
||||
int mb_height = (s->height + v * block_size - 1) / (v * block_size);
|
||||
|
||||
if (~s->coefs_finished[c])
|
||||
av_log(s->avctx, AV_LOG_WARNING, "component %d is incomplete\n", c);
|
||||
|
||||
if (s->interlaced && s->bottom_field)
|
||||
data += linesize >> 1;
|
||||
|
||||
for (mb_y = 0; mb_y < mb_height; mb_y++) {
|
||||
uint8_t *ptr = data + (mb_y * linesize * 8 >> s->avctx->lowres);
|
||||
int block_idx = mb_y * s->block_stride[c];
|
||||
int16_t (*block)[64] = &s->blocks[c][block_idx];
|
||||
for (mb_x = 0; mb_x < mb_width; mb_x++, block++) {
|
||||
s->idsp.idct_put(ptr, linesize, *block);
|
||||
if (s->bits & 7)
|
||||
shift_output(s, ptr, linesize);
|
||||
ptr += bytes_per_pixel*8 >> s->avctx->lowres;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask,
|
||||
int mb_bitmask_size, const AVFrame *reference)
|
||||
{
|
||||
@@ -2162,6 +2182,8 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
break;
|
||||
case EOI:
|
||||
eoi_parser:
|
||||
if (avctx->skip_frame != AVDISCARD_ALL && s->progressive && s->cur_scan && s->got_picture)
|
||||
mjpeg_idct_scan_progressive_ac(s);
|
||||
s->cur_scan = 0;
|
||||
if (!s->got_picture) {
|
||||
av_log(avctx, AV_LOG_WARNING,
|
||||
|
@@ -1216,6 +1216,8 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
}
|
||||
|
||||
ff_mpeg_unref_picture(s->avctx, &s->current_picture);
|
||||
ff_mpeg_unref_picture(s->avctx, &s->last_picture);
|
||||
ff_mpeg_unref_picture(s->avctx, &s->next_picture);
|
||||
|
||||
/* release non reference frames */
|
||||
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
|
||||
@@ -1367,14 +1369,12 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
memset(s->next_picture.f->data, 0, sizeof(s->next_picture.f->data));
|
||||
#endif
|
||||
if (s->last_picture_ptr) {
|
||||
ff_mpeg_unref_picture(s->avctx, &s->last_picture);
|
||||
if (s->last_picture_ptr->f->buf[0] &&
|
||||
(ret = ff_mpeg_ref_picture(s->avctx, &s->last_picture,
|
||||
s->last_picture_ptr)) < 0)
|
||||
return ret;
|
||||
}
|
||||
if (s->next_picture_ptr) {
|
||||
ff_mpeg_unref_picture(s->avctx, &s->next_picture);
|
||||
if (s->next_picture_ptr->f->buf[0] &&
|
||||
(ret = ff_mpeg_ref_picture(s->avctx, &s->next_picture,
|
||||
s->next_picture_ptr)) < 0)
|
||||
|
@@ -223,6 +223,12 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
ff_dlog(avctx, "pixel_size %d packed_size %d.\n", pixel_size, packed_size);
|
||||
|
||||
if (packed_size < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid tile size %d\n", packed_size);
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Get pixels buffer, it may be deflated or just raw */
|
||||
if (pixel_size == packed_size) {
|
||||
if (bytestream2_get_bytes_left(gbc) < pixel_size) {
|
||||
@@ -233,6 +239,11 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
pixels = gbc->buffer;
|
||||
} else {
|
||||
uLongf len = ctx->inflated_size;
|
||||
if (bytestream2_get_bytes_left(gbc) < packed_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Insufficient input for %d\n", packed_size);
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto end;
|
||||
}
|
||||
ret = uncompress(ctx->inflated_buf, &len, gbc->buffer, packed_size);
|
||||
if (ret) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Pixel deflate error %d.\n", ret);
|
||||
|
@@ -1695,6 +1695,8 @@ static int guess_ni_flag(AVFormatContext *s)
|
||||
size = avio_rl32(s->pb);
|
||||
if (get_stream_idx(tag) == i && pos + size > st->index_entries[1].pos)
|
||||
last_start = INT64_MAX;
|
||||
if (get_stream_idx(tag) == i && size == st->index_entries[0].size + 8)
|
||||
last_start = INT64_MAX;
|
||||
}
|
||||
|
||||
if (st->index_entries[0].pos > last_start)
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "ffm.h"
|
||||
@@ -377,6 +378,11 @@ static int ffm2_read_header(AVFormatContext *s)
|
||||
codec->height = avio_rb16(pb);
|
||||
codec->gop_size = avio_rb16(pb);
|
||||
codec->pix_fmt = avio_rb32(pb);
|
||||
if (!av_pix_fmt_desc_get(codec->pix_fmt)) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid pix fmt id: %d\n", codec->pix_fmt);
|
||||
codec->pix_fmt = AV_PIX_FMT_NONE;
|
||||
goto fail;
|
||||
}
|
||||
codec->qmin = avio_r8(pb);
|
||||
codec->qmax = avio_r8(pb);
|
||||
codec->max_qdiff = avio_r8(pb);
|
||||
@@ -569,6 +575,11 @@ static int ffm_read_header(AVFormatContext *s)
|
||||
codec->height = avio_rb16(pb);
|
||||
codec->gop_size = avio_rb16(pb);
|
||||
codec->pix_fmt = avio_rb32(pb);
|
||||
if (!av_pix_fmt_desc_get(codec->pix_fmt)) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid pix fmt id: %d\n", codec->pix_fmt);
|
||||
codec->pix_fmt = AV_PIX_FMT_NONE;
|
||||
goto fail;
|
||||
}
|
||||
codec->qmin = avio_r8(pb);
|
||||
codec->qmax = avio_r8(pb);
|
||||
codec->max_qdiff = avio_r8(pb);
|
||||
|
@@ -193,6 +193,8 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
|
||||
|
||||
if (sep)
|
||||
p = sep + 1;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ctx->playpath) {
|
||||
|
@@ -2441,7 +2441,7 @@ static int mpegts_probe(AVProbeData *p)
|
||||
#define CHECK_COUNT 10
|
||||
#define CHECK_BLOCK 100
|
||||
|
||||
if (check_count < CHECK_COUNT)
|
||||
if (!check_count)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i<check_count; i+=CHECK_BLOCK) {
|
||||
@@ -2459,10 +2459,15 @@ static int mpegts_probe(AVProbeData *p)
|
||||
|
||||
ff_dlog(0, "TS score: %d %d\n", sumscore, maxscore);
|
||||
|
||||
if (sumscore > 6) return AVPROBE_SCORE_MAX + sumscore - CHECK_COUNT;
|
||||
else if (maxscore > 6) return AVPROBE_SCORE_MAX/2 + sumscore - CHECK_COUNT;
|
||||
else
|
||||
if (check_count >= CHECK_COUNT && sumscore > 6) {
|
||||
return AVPROBE_SCORE_MAX + sumscore - CHECK_COUNT;
|
||||
} else if (check_count >= CHECK_COUNT && maxscore > 6) {
|
||||
return AVPROBE_SCORE_MAX/2 + sumscore - CHECK_COUNT;
|
||||
} else if (sumscore > 6) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* return the 90kHz PCR and the extension for the 27MHz PCR. return
|
||||
|
@@ -701,6 +701,7 @@ static int ogg_read_header(AVFormatContext *s)
|
||||
if (ogg->streams[i].header < 0) {
|
||||
av_log(s, AV_LOG_ERROR, "Header parsing failed for stream %d\n", i);
|
||||
ogg->streams[i].codec = NULL;
|
||||
av_freep(&ogg->streams[i].private);
|
||||
} else if (os->codec && os->nb_header < os->codec->nb_header) {
|
||||
av_log(s, AV_LOG_WARNING,
|
||||
"Headers mismatch for stream %d: "
|
||||
|
@@ -117,6 +117,10 @@ static int opus_packet(AVFormatContext *avf, int idx)
|
||||
|
||||
if (!os->psize)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (os->granule > (1LL << 62)) {
|
||||
av_log(avf, AV_LOG_ERROR, "Unsupported huge granule pos %"PRId64 "\n", os->granule);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS)) {
|
||||
int seg, d;
|
||||
|
@@ -82,7 +82,11 @@ static uint64_t vp8_gptopts(AVFormatContext *s, int idx,
|
||||
struct ogg *ogg = s->priv_data;
|
||||
struct ogg_stream *os = ogg->streams + idx;
|
||||
|
||||
uint64_t pts = (granule >> 32);
|
||||
int invcnt = !((granule >> 30) & 3);
|
||||
// If page granule is that of an invisible vp8 frame, its pts will be
|
||||
// that of the end of the next visible frame. We substract 1 for those
|
||||
// to prevent messing up pts calculations.
|
||||
uint64_t pts = (granule >> 32) - invcnt;
|
||||
uint32_t dist = (granule >> 3) & 0x07ffffff;
|
||||
|
||||
if (!dist)
|
||||
|
@@ -87,6 +87,7 @@ static const AVOption avformat_options[] = {
|
||||
{"max_interleave_delta", "maximum buffering duration for interleaving", OFFSET(max_interleave_delta), AV_OPT_TYPE_INT64, { .i64 = 10000000 }, 0, INT64_MAX, E },
|
||||
{"f_strict", "how strictly to follow the standards (deprecated; use strict, save via avconv)", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
{"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
{"very", "strictly conform to a older more strict version of the spec or reference software", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_VERY_STRICT }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
{"strict", "strictly conform to all the things in the spec no matter what the consequences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
{"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
|
@@ -2370,7 +2370,7 @@ static void update_stream_timings(AVFormatContext *ic)
|
||||
end_time1 = av_rescale_q_rnd(st->duration, st->time_base,
|
||||
AV_TIME_BASE_Q,
|
||||
AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
|
||||
if (end_time1 != AV_NOPTS_VALUE) {
|
||||
if (end_time1 != AV_NOPTS_VALUE && start_time1 <= INT64_MAX - end_time1) {
|
||||
end_time1 += start_time1;
|
||||
end_time = FFMAX(end_time, end_time1);
|
||||
}
|
||||
@@ -2408,7 +2408,7 @@ static void update_stream_timings(AVFormatContext *ic)
|
||||
if (duration != INT64_MIN && duration > 0 && ic->duration == AV_NOPTS_VALUE) {
|
||||
ic->duration = duration;
|
||||
}
|
||||
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration != AV_NOPTS_VALUE) {
|
||||
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration > 0) {
|
||||
/* compute the bitrate */
|
||||
double bitrate = (double) filesize * 8.0 * AV_TIME_BASE /
|
||||
(double) ic->duration;
|
||||
@@ -2833,6 +2833,9 @@ enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
|
||||
|
||||
enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags)
|
||||
{
|
||||
if (bps <= 0 || bps > 64)
|
||||
return AV_CODEC_ID_NONE;
|
||||
|
||||
if (flt) {
|
||||
switch (bps) {
|
||||
case 32:
|
||||
@@ -2916,7 +2919,7 @@ static void compute_chapters_end(AVFormatContext *s)
|
||||
unsigned int i, j;
|
||||
int64_t max_time = 0;
|
||||
|
||||
if (s->duration > 0)
|
||||
if (s->duration > 0 && s->start_time < INT64_MAX - s->duration)
|
||||
max_time = s->duration +
|
||||
((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time);
|
||||
|
||||
|
@@ -32,6 +32,9 @@
|
||||
|
||||
#define TEMPLATE_REMATRIX_S16
|
||||
#include "rematrix_template.c"
|
||||
#define TEMPLATE_CLIP
|
||||
#include "rematrix_template.c"
|
||||
#undef TEMPLATE_CLIP
|
||||
#undef TEMPLATE_REMATRIX_S16
|
||||
|
||||
#define TEMPLATE_REMATRIX_S32
|
||||
@@ -367,17 +370,33 @@ av_cold int swri_rematrix_init(SwrContext *s){
|
||||
return r;
|
||||
}
|
||||
if (s->midbuf.fmt == AV_SAMPLE_FMT_S16P){
|
||||
int maxsum = 0;
|
||||
s->native_matrix = av_calloc(nb_in * nb_out, sizeof(int));
|
||||
s->native_one = av_mallocz(sizeof(int));
|
||||
if (!s->native_matrix || !s->native_one)
|
||||
return AVERROR(ENOMEM);
|
||||
for (i = 0; i < nb_out; i++)
|
||||
for (j = 0; j < nb_in; j++)
|
||||
((int*)s->native_matrix)[i * nb_in + j] = lrintf(s->matrix[i][j] * 32768);
|
||||
for (i = 0; i < nb_out; i++) {
|
||||
double rem = 0;
|
||||
int sum = 0;
|
||||
|
||||
for (j = 0; j < nb_in; j++) {
|
||||
double target = s->matrix[i][j] * 32768 + rem;
|
||||
((int*)s->native_matrix)[i * nb_in + j] = lrintf(target);
|
||||
rem += target - ((int*)s->native_matrix)[i * nb_in + j];
|
||||
sum += FFABS(((int*)s->native_matrix)[i * nb_in + j]);
|
||||
}
|
||||
maxsum = FFMAX(maxsum, sum);
|
||||
}
|
||||
*((int*)s->native_one) = 32768;
|
||||
s->mix_1_1_f = (mix_1_1_func_type*)copy_s16;
|
||||
s->mix_2_1_f = (mix_2_1_func_type*)sum2_s16;
|
||||
s->mix_any_f = (mix_any_func_type*)get_mix_any_func_s16(s);
|
||||
if (maxsum <= 32768) {
|
||||
s->mix_1_1_f = (mix_1_1_func_type*)copy_s16;
|
||||
s->mix_2_1_f = (mix_2_1_func_type*)sum2_s16;
|
||||
s->mix_any_f = (mix_any_func_type*)get_mix_any_func_s16(s);
|
||||
} else {
|
||||
s->mix_1_1_f = (mix_1_1_func_type*)copy_clip_s16;
|
||||
s->mix_2_1_f = (mix_2_1_func_type*)sum2_clip_s16;
|
||||
s->mix_any_f = (mix_any_func_type*)get_mix_any_func_clip_s16(s);
|
||||
}
|
||||
}else if(s->midbuf.fmt == AV_SAMPLE_FMT_FLTP){
|
||||
s->native_matrix = av_calloc(nb_in * nb_out, sizeof(float));
|
||||
s->native_one = av_mallocz(sizeof(float));
|
||||
|
@@ -31,11 +31,16 @@
|
||||
# define INTER double
|
||||
# define RENAME(x) x ## _double
|
||||
#elif defined(TEMPLATE_REMATRIX_S16)
|
||||
# define R(x) (((x) + 16384)>>15)
|
||||
# define SAMPLE int16_t
|
||||
# define COEFF int
|
||||
# define INTER int
|
||||
# ifdef TEMPLATE_CLIP
|
||||
# define R(x) av_clip_int16(((x) + 16384)>>15)
|
||||
# define RENAME(x) x ## _clip_s16
|
||||
# else
|
||||
# define R(x) (((x) + 16384)>>15)
|
||||
# define RENAME(x) x ## _s16
|
||||
# endif
|
||||
#elif defined(TEMPLATE_REMATRIX_S32)
|
||||
# define R(x) (((x) + 16384)>>15)
|
||||
# define SAMPLE int32_t
|
||||
|
@@ -203,7 +203,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
|
||||
case AV_SAMPLE_FMT_S16P:
|
||||
for(i=0;i<tap_count;i++)
|
||||
((int16_t*)filter)[ph * alloc + i] = av_clip_int16(lrintf(tab[i] * scale / norm));
|
||||
if (tap_count % 2 == 0) {
|
||||
if (tap_count % 2 == 0 || tap_count == 1) {
|
||||
for (i = 0; i < tap_count; i++)
|
||||
((int16_t*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((int16_t*)filter)[ph * alloc + i];
|
||||
}
|
||||
@@ -216,7 +216,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
|
||||
case AV_SAMPLE_FMT_S32P:
|
||||
for(i=0;i<tap_count;i++)
|
||||
((int32_t*)filter)[ph * alloc + i] = av_clipl_int32(llrint(tab[i] * scale / norm));
|
||||
if (tap_count % 2 == 0) {
|
||||
if (tap_count % 2 == 0 || tap_count == 1) {
|
||||
for (i = 0; i < tap_count; i++)
|
||||
((int32_t*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((int32_t*)filter)[ph * alloc + i];
|
||||
}
|
||||
@@ -229,7 +229,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
|
||||
case AV_SAMPLE_FMT_FLTP:
|
||||
for(i=0;i<tap_count;i++)
|
||||
((float*)filter)[ph * alloc + i] = tab[i] * scale / norm;
|
||||
if (tap_count % 2 == 0) {
|
||||
if (tap_count % 2 == 0 || tap_count == 1) {
|
||||
for (i = 0; i < tap_count; i++)
|
||||
((float*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((float*)filter)[ph * alloc + i];
|
||||
}
|
||||
@@ -241,7 +241,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
|
||||
case AV_SAMPLE_FMT_DBLP:
|
||||
for(i=0;i<tap_count;i++)
|
||||
((double*)filter)[ph * alloc + i] = tab[i] * scale / norm;
|
||||
if (tap_count % 2 == 0) {
|
||||
if (tap_count % 2 == 0 || tap_count == 1) {
|
||||
for (i = 0; i < tap_count; i++)
|
||||
((double*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((double*)filter)[ph * alloc + i];
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ static const struct {
|
||||
#if CONFIG_JPEG2000_DECODER
|
||||
{ "jpeg2000dsp", checkasm_check_jpeg2000dsp },
|
||||
#endif
|
||||
#if CONFIG_PIXBLOCKDSP
|
||||
#if CONFIG_PIXBLOCKDSP && !(ARCH_PPC64 && HAVE_BIGENDIAN)
|
||||
{ "pixblockdsp", checkasm_check_pixblockdsp },
|
||||
#endif
|
||||
#if CONFIG_V210_ENCODER
|
||||
|
Reference in New Issue
Block a user