Compare commits
59 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
205e2264c3 | ||
![]() |
4a23765704 | ||
![]() |
083d0b7b2d | ||
![]() |
1e9ae5dbbd | ||
![]() |
01e2dd53a0 | ||
![]() |
b93659db5b | ||
![]() |
b94621ac6b | ||
![]() |
a2b4e38729 | ||
![]() |
9fe7e45030 | ||
![]() |
3c169251ee | ||
![]() |
81a2740919 | ||
![]() |
a144d305dd | ||
![]() |
4965da92ef | ||
![]() |
a83304814c | ||
![]() |
db6f3be941 | ||
![]() |
2f1f407044 | ||
![]() |
bdd2f7c7a7 | ||
![]() |
332777970c | ||
![]() |
62b9c99aec | ||
![]() |
0e18480fc3 | ||
![]() |
99d4d3532f | ||
![]() |
d9d66d2d16 | ||
![]() |
db33fb1c48 | ||
![]() |
0be9a2e9d9 | ||
![]() |
ee282be99b | ||
![]() |
d3bcc9cfa9 | ||
![]() |
eaa6d79105 | ||
![]() |
4d9aad95b5 | ||
![]() |
6882a04706 | ||
![]() |
98805cbac5 | ||
![]() |
66ca450fcb | ||
![]() |
8162b69091 | ||
![]() |
ed38ed3b62 | ||
![]() |
6f6f5f9c8b | ||
![]() |
690a3c4fb7 | ||
![]() |
2ca68b98ba | ||
![]() |
853bbe1aed | ||
![]() |
218c853774 | ||
![]() |
e315549ffa | ||
![]() |
c9ed7a4fc1 | ||
![]() |
1c321b7c31 | ||
![]() |
491e1ec95d | ||
![]() |
5805c0c2b6 | ||
![]() |
c61c66cfb1 | ||
![]() |
5ac53d07a2 | ||
![]() |
02055da69a | ||
![]() |
c7f419efd1 | ||
![]() |
b556432f5a | ||
![]() |
102df43f49 | ||
![]() |
36fc9bff08 | ||
![]() |
3ae71dd33e | ||
![]() |
673f679c8a | ||
![]() |
f65501f80c | ||
![]() |
6387aa94d6 | ||
![]() |
d581567e09 | ||
![]() |
9933e06595 | ||
![]() |
91d024d75d | ||
![]() |
5ee384c4eb | ||
![]() |
9ecd0f34ad |
@@ -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.0.4
|
||||
PROJECT_NUMBER = 2.0.5
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
@@ -33,7 +33,7 @@ Select nearest neighbor rescaling algorithm.
|
||||
@item area
|
||||
Select averaging area rescaling algorithm.
|
||||
|
||||
@item bicubiclin
|
||||
@item bicublin
|
||||
Select bicubic scaling algorithm for the luma component, bilinear for
|
||||
chroma components.
|
||||
|
||||
|
2
ffmpeg.c
2
ffmpeg.c
@@ -319,7 +319,7 @@ sigterm_handler(int sig)
|
||||
received_nb_signals++;
|
||||
term_exit();
|
||||
if(received_nb_signals > 3)
|
||||
exit_program(123);
|
||||
exit(123);
|
||||
}
|
||||
|
||||
void term_init(void)
|
||||
|
@@ -42,12 +42,15 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
|
||||
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
|
||||
enum AVPixelFormat best= AV_PIX_FMT_NONE;
|
||||
const enum AVPixelFormat mjpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
|
||||
const enum AVPixelFormat ljpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
|
||||
|
||||
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
|
||||
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
|
||||
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
|
||||
p = mjpeg_formats;
|
||||
} else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
|
||||
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
|
||||
p =ljpeg_formats;
|
||||
}
|
||||
}
|
||||
for (; *p != AV_PIX_FMT_NONE; p++) {
|
||||
|
@@ -81,7 +81,7 @@ enum BandType {
|
||||
INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions.
|
||||
};
|
||||
|
||||
#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
|
||||
#define IS_CODEBOOK_UNSIGNED(x) (((x) - 1) & 10)
|
||||
|
||||
enum ChannelPosition {
|
||||
AAC_CHANNEL_OFF = 0,
|
||||
|
@@ -150,6 +150,7 @@ typedef struct AICContext {
|
||||
int16_t *data_ptr[NUM_BANDS];
|
||||
|
||||
DECLARE_ALIGNED(16, int16_t, block)[64];
|
||||
DECLARE_ALIGNED(16, uint8_t, quant_matrix)[64];
|
||||
} AICContext;
|
||||
|
||||
static int aic_decode_header(AICContext *ctx, const uint8_t *src, int size)
|
||||
@@ -285,7 +286,7 @@ static void recombine_block_il(int16_t *dst, const uint8_t *scan,
|
||||
}
|
||||
}
|
||||
|
||||
static void unquant_block(int16_t *block, int q)
|
||||
static void unquant_block(int16_t *block, int q, uint8_t *quant_matrix)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -293,7 +294,7 @@ static void unquant_block(int16_t *block, int q)
|
||||
int val = (uint16_t)block[i];
|
||||
int sign = val & 1;
|
||||
|
||||
block[i] = (((val >> 1) ^ -sign) * q * aic_quant_matrix[i] >> 4)
|
||||
block[i] = (((val >> 1) ^ -sign) * q * quant_matrix[i] >> 4)
|
||||
+ sign;
|
||||
}
|
||||
}
|
||||
@@ -334,7 +335,7 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
|
||||
else
|
||||
recombine_block_il(ctx->block, ctx->scantable.permutated,
|
||||
&base_y, &ext_y, blk);
|
||||
unquant_block(ctx->block, ctx->quant);
|
||||
unquant_block(ctx->block, ctx->quant, ctx->quant_matrix);
|
||||
ctx->dsp.idct(ctx->block);
|
||||
|
||||
if (!ctx->interlaced) {
|
||||
@@ -352,7 +353,7 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
|
||||
for (blk = 0; blk < 2; blk++) {
|
||||
recombine_block(ctx->block, ctx->scantable.permutated,
|
||||
&base_c, &ext_c);
|
||||
unquant_block(ctx->block, ctx->quant);
|
||||
unquant_block(ctx->block, ctx->quant, ctx->quant_matrix);
|
||||
ctx->dsp.idct(ctx->block);
|
||||
ctx->dsp.put_signed_pixels_clamped(ctx->block, C[blk],
|
||||
ctx->frame->linesize[blk + 1]);
|
||||
@@ -430,6 +431,8 @@ static av_cold int aic_decode_init(AVCodecContext *avctx)
|
||||
for (i = 0; i < 64; i++)
|
||||
scan[i] = i;
|
||||
ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, scan);
|
||||
for (i = 0; i < 64; i++)
|
||||
ctx->quant_matrix[ctx->dsp.idct_permutation[i]] = aic_quant_matrix[i];
|
||||
|
||||
ctx->mb_width = FFALIGN(avctx->width, 16) >> 4;
|
||||
ctx->mb_height = FFALIGN(avctx->height, 16) >> 4;
|
||||
|
@@ -280,7 +280,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
|
||||
GetBitContext gb;
|
||||
uint64_t ht_size;
|
||||
int i, config_offset;
|
||||
MPEG4AudioConfig m4ac;
|
||||
MPEG4AudioConfig m4ac = {0};
|
||||
ALSSpecificConfig *sconf = &ctx->sconf;
|
||||
AVCodecContext *avctx = ctx->avctx;
|
||||
uint32_t als_id, header_size, trailer_size;
|
||||
|
@@ -214,6 +214,7 @@ typedef struct AVSContext {
|
||||
int luma_scan[4];
|
||||
int qp;
|
||||
int qp_fixed;
|
||||
int pic_qp_fixed;
|
||||
int cbp;
|
||||
ScanTable scantable;
|
||||
|
||||
|
@@ -900,7 +900,7 @@ static inline int decode_slice_header(AVSContext *h, GetBitContext *gb)
|
||||
|
||||
/* mark top macroblocks as unavailable */
|
||||
h->flags &= ~(B_AVAIL | C_AVAIL);
|
||||
if ((h->mby == 0) && (!h->qp_fixed)) {
|
||||
if (!h->pic_qp_fixed) {
|
||||
h->qp_fixed = get_bits1(gb);
|
||||
h->qp = get_bits(gb, 6);
|
||||
}
|
||||
@@ -1018,6 +1018,7 @@ static int decode_pic(AVSContext *h)
|
||||
skip_bits1(&h->gb); //advanced_pred_mode_disable
|
||||
skip_bits1(&h->gb); //top_field_first
|
||||
skip_bits1(&h->gb); //repeat_first_field
|
||||
h->pic_qp_fixed =
|
||||
h->qp_fixed = get_bits1(&h->gb);
|
||||
h->qp = get_bits(&h->gb, 6);
|
||||
if (h->cur.f->pict_type == AV_PICTURE_TYPE_I) {
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#ifndef AVCODEC_DIRAC_ARITH_H
|
||||
#define AVCODEC_DIRAC_ARITH_H
|
||||
|
||||
#include "libavutil/x86/asm.h"
|
||||
#include "bytestream.h"
|
||||
#include "get_bits.h"
|
||||
|
||||
@@ -134,7 +135,7 @@ static inline int dirac_get_arith_bit(DiracArith *c, int ctx)
|
||||
|
||||
range_times_prob = (c->range * prob_zero) >> 16;
|
||||
|
||||
#if HAVE_FAST_CMOV && HAVE_INLINE_ASM
|
||||
#if HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS
|
||||
low -= range_times_prob << 16;
|
||||
range -= range_times_prob;
|
||||
bit = 0;
|
||||
|
@@ -201,6 +201,7 @@ typedef struct DiracContext {
|
||||
|
||||
uint16_t *mctmp; /* buffer holding the MC data multipled by OBMC weights */
|
||||
uint8_t *mcscratch;
|
||||
int buffer_stride;
|
||||
|
||||
DECLARE_ALIGNED(16, uint8_t, obmc_weight)[3][MAX_BLOCKSIZE*MAX_BLOCKSIZE];
|
||||
|
||||
@@ -343,22 +344,44 @@ static int alloc_sequence_buffers(DiracContext *s)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
w = s->source.width;
|
||||
h = s->source.height;
|
||||
|
||||
/* fixme: allocate using real stride here */
|
||||
s->sbsplit = av_malloc(sbwidth * sbheight);
|
||||
s->blmotion = av_malloc(sbwidth * sbheight * 16 * sizeof(*s->blmotion));
|
||||
s->edge_emu_buffer_base = av_malloc((w+64)*MAX_BLOCKSIZE);
|
||||
s->sbsplit = av_malloc_array(sbwidth, sbheight);
|
||||
s->blmotion = av_malloc_array(sbwidth, sbheight * 16 * sizeof(*s->blmotion));
|
||||
|
||||
s->mctmp = av_malloc((w+64+MAX_BLOCKSIZE) * (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
|
||||
s->mcscratch = av_malloc((w+64)*MAX_BLOCKSIZE);
|
||||
|
||||
if (!s->sbsplit || !s->blmotion || !s->mctmp || !s->mcscratch)
|
||||
if (!s->sbsplit || !s->blmotion)
|
||||
return AVERROR(ENOMEM);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int alloc_buffers(DiracContext *s, int stride)
|
||||
{
|
||||
int w = s->source.width;
|
||||
int h = s->source.height;
|
||||
|
||||
av_assert0(stride >= w);
|
||||
stride += 64;
|
||||
|
||||
if (s->buffer_stride >= stride)
|
||||
return 0;
|
||||
s->buffer_stride = 0;
|
||||
|
||||
av_freep(&s->edge_emu_buffer_base);
|
||||
memset(s->edge_emu_buffer, 0, sizeof(s->edge_emu_buffer));
|
||||
av_freep(&s->mctmp);
|
||||
av_freep(&s->mcscratch);
|
||||
|
||||
s->edge_emu_buffer_base = av_malloc_array(stride, MAX_BLOCKSIZE);
|
||||
|
||||
s->mctmp = av_malloc_array((stride+MAX_BLOCKSIZE), (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
|
||||
s->mcscratch = av_malloc_array(stride, MAX_BLOCKSIZE);
|
||||
|
||||
if (!s->edge_emu_buffer_base || !s->mctmp || !s->mcscratch)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
s->buffer_stride = stride;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void free_sequence_buffers(DiracContext *s)
|
||||
{
|
||||
int i, j, k;
|
||||
@@ -382,6 +405,7 @@ static void free_sequence_buffers(DiracContext *s)
|
||||
av_freep(&s->plane[i].idwt_tmp);
|
||||
}
|
||||
|
||||
s->buffer_stride = 0;
|
||||
av_freep(&s->sbsplit);
|
||||
av_freep(&s->blmotion);
|
||||
av_freep(&s->edge_emu_buffer_base);
|
||||
@@ -1343,8 +1367,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
|
||||
motion_y >>= s->chroma_y_shift;
|
||||
}
|
||||
|
||||
mx = motion_x & ~(-1 << s->mv_precision);
|
||||
my = motion_y & ~(-1 << s->mv_precision);
|
||||
mx = motion_x & ~(-1U << s->mv_precision);
|
||||
my = motion_y & ~(-1U << s->mv_precision);
|
||||
motion_x >>= s->mv_precision;
|
||||
motion_y >>= s->mv_precision;
|
||||
/* normalize subpel coordinates to epel */
|
||||
@@ -1818,6 +1842,9 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
|
||||
s->plane[1].stride = pic->avframe.linesize[1];
|
||||
s->plane[2].stride = pic->avframe.linesize[2];
|
||||
|
||||
if (alloc_buffers(s, FFMAX3(FFABS(s->plane[0].stride), FFABS(s->plane[1].stride), FFABS(s->plane[2].stride))) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
/* [DIRAC_STD] 11.1 Picture parse. picture_parse() */
|
||||
if (dirac_decode_picture_header(s))
|
||||
return -1;
|
||||
|
@@ -2286,7 +2286,8 @@ static int pack_bitstream(G723_1_Context *p, unsigned char *frame, int size)
|
||||
if (p->cur_rate == RATE_6300) {
|
||||
info_bits = 0;
|
||||
put_bits(&pb, 2, info_bits);
|
||||
}
|
||||
}else
|
||||
av_assert0(0);
|
||||
|
||||
put_bits(&pb, 8, p->lsp_index[2]);
|
||||
put_bits(&pb, 8, p->lsp_index[1]);
|
||||
|
@@ -58,7 +58,7 @@ int main(void)
|
||||
}
|
||||
}
|
||||
|
||||
#define EXTEND(i) (i << 3 | i & 7)
|
||||
#define EXTEND(i) ((i) << 3 | (i) & 7)
|
||||
init_put_bits(&pb, temp, SIZE);
|
||||
for (i = 0; i < COUNT; i++)
|
||||
set_ue_golomb(&pb, EXTEND(i));
|
||||
|
@@ -718,10 +718,10 @@ frame_end:
|
||||
}
|
||||
|
||||
if(startcode_found){
|
||||
av_fast_malloc(
|
||||
av_fast_padded_mallocz(
|
||||
&s->bitstream_buffer,
|
||||
&s->allocated_bitstream_buffer_size,
|
||||
buf_size - current_pos + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
buf_size - current_pos);
|
||||
if (!s->bitstream_buffer)
|
||||
return AVERROR(ENOMEM);
|
||||
memcpy(s->bitstream_buffer, buf + current_pos, buf_size - current_pos);
|
||||
|
@@ -1682,6 +1682,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
|
||||
memset(&h->mb, 0, sizeof(h->mb));
|
||||
memset(&h->mb_luma_dc, 0, sizeof(h->mb_luma_dc));
|
||||
memset(&h->mb_padding, 0, sizeof(h->mb_padding));
|
||||
memset(&h->cur_pic, 0, sizeof(h->cur_pic));
|
||||
|
||||
h->avctx = dst;
|
||||
h->DPB = NULL;
|
||||
|
@@ -61,10 +61,10 @@
|
||||
#define MAX_SLICES 16
|
||||
|
||||
#ifdef ALLOW_INTERLACE
|
||||
#define MB_MBAFF(h) h->mb_mbaff
|
||||
#define MB_FIELD(h) h->mb_field_decoding_flag
|
||||
#define FRAME_MBAFF(h) h->mb_aff_frame
|
||||
#define FIELD_PICTURE(h) (h->picture_structure != PICT_FRAME)
|
||||
#define MB_MBAFF(h) (h)->mb_mbaff
|
||||
#define MB_FIELD(h) (h)->mb_field_decoding_flag
|
||||
#define FRAME_MBAFF(h) (h)->mb_aff_frame
|
||||
#define FIELD_PICTURE(h) ((h)->picture_structure != PICT_FRAME)
|
||||
#define LEFT_MBS 2
|
||||
#define LTOP 0
|
||||
#define LBOT 1
|
||||
@@ -84,12 +84,12 @@
|
||||
#define FIELD_OR_MBAFF_PICTURE(h) (FRAME_MBAFF(h) || FIELD_PICTURE(h))
|
||||
|
||||
#ifndef CABAC
|
||||
#define CABAC(h) h->pps.cabac
|
||||
#define CABAC(h) (h)->pps.cabac
|
||||
#endif
|
||||
|
||||
#define CHROMA(h) (h->sps.chroma_format_idc)
|
||||
#define CHROMA422(h) (h->sps.chroma_format_idc == 2)
|
||||
#define CHROMA444(h) (h->sps.chroma_format_idc == 3)
|
||||
#define CHROMA(h) ((h)->sps.chroma_format_idc)
|
||||
#define CHROMA422(h) ((h)->sps.chroma_format_idc == 2)
|
||||
#define CHROMA444(h) ((h)->sps.chroma_format_idc == 3)
|
||||
|
||||
#define EXTENDED_SAR 255
|
||||
|
||||
|
@@ -172,7 +172,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
|
||||
goto fail;
|
||||
|
||||
/* prepend only to the first type 5 NAL unit of an IDR picture */
|
||||
if (ctx->first_idr && unit_type == 5) {
|
||||
if (ctx->first_idr && (unit_type == 5 || unit_type == 7 || unit_type == 8)) {
|
||||
if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
|
||||
avctx->extradata, avctx->extradata_size,
|
||||
buf, nal_size)) < 0)
|
||||
|
@@ -235,15 +235,15 @@ void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
|
||||
|
||||
/** butterfly operation for the inverse Haar transform */
|
||||
#define IVI_HAAR_BFLY(s1, s2, o1, o2, t) \
|
||||
t = (s1 - s2) >> 1;\
|
||||
o1 = (s1 + s2) >> 1;\
|
||||
o2 = t;\
|
||||
t = ((s1) - (s2)) >> 1;\
|
||||
o1 = ((s1) + (s2)) >> 1;\
|
||||
o2 = (t);\
|
||||
|
||||
/** inverse 8-point Haar transform */
|
||||
#define INV_HAAR8(s1, s5, s3, s7, s2, s4, s6, s8,\
|
||||
d1, d2, d3, d4, d5, d6, d7, d8,\
|
||||
t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
|
||||
t1 = s1 << 1; t5 = s5 << 1;\
|
||||
t1 = (s1) << 1; t5 = (s5) << 1;\
|
||||
IVI_HAAR_BFLY(t1, t5, t1, t5, t0); IVI_HAAR_BFLY(t1, s3, t1, t3, t0);\
|
||||
IVI_HAAR_BFLY(t5, s7, t5, t7, t0); IVI_HAAR_BFLY(t1, s2, t1, t2, t0);\
|
||||
IVI_HAAR_BFLY(t3, s4, t3, t4, t0); IVI_HAAR_BFLY(t5, s6, t5, t6, t0);\
|
||||
@@ -485,21 +485,21 @@ void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
|
||||
|
||||
/** butterfly operation for the inverse slant transform */
|
||||
#define IVI_SLANT_BFLY(s1, s2, o1, o2, t) \
|
||||
t = s1 - s2;\
|
||||
o1 = s1 + s2;\
|
||||
o2 = t;\
|
||||
t = (s1) - (s2);\
|
||||
o1 = (s1) + (s2);\
|
||||
o2 = (t);\
|
||||
|
||||
/** This is a reflection a,b = 1/2, 5/4 for the inverse slant transform */
|
||||
#define IVI_IREFLECT(s1, s2, o1, o2, t) \
|
||||
t = ((s1 + s2*2 + 2) >> 2) + s1;\
|
||||
o2 = ((s1*2 - s2 + 2) >> 2) - s2;\
|
||||
o1 = t;\
|
||||
t = (((s1) + (s2)*2 + 2) >> 2) + (s1);\
|
||||
o2 = (((s1)*2 - (s2) + 2) >> 2) - (s2);\
|
||||
o1 = (t);\
|
||||
|
||||
/** This is a reflection a,b = 1/2, 7/8 for the inverse slant transform */
|
||||
#define IVI_SLANT_PART4(s1, s2, o1, o2, t) \
|
||||
t = s2 + ((s1*4 - s2 + 4) >> 3);\
|
||||
o2 = s1 + ((-s1 - s2*4 + 4) >> 3);\
|
||||
o1 = t;\
|
||||
t = (s2) + (((s1)*4 - (s2) + 4) >> 3);\
|
||||
o2 = (s1) + ((-(s1) - (s2)*4 + 4) >> 3);\
|
||||
o1 = (t);\
|
||||
|
||||
/** inverse slant8 transform */
|
||||
#define IVI_INV_SLANT8(s1, s4, s8, s5, s2, s6, s3, s7,\
|
||||
@@ -557,7 +557,7 @@ void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, c
|
||||
}
|
||||
#undef COMPENSATE
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
src = tmp;
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (!src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) {
|
||||
@@ -597,7 +597,7 @@ void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, c
|
||||
}
|
||||
#undef COMPENSATE
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
src = tmp;
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (!src[0] && !src[1] && !src[2] && !src[3]) {
|
||||
@@ -631,7 +631,7 @@ void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const ui
|
||||
int i;
|
||||
int t0, t1, t2, t3, t4, t5, t6, t7, t8;
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (!in[0] && !in[1] && !in[2] && !in[3] && !in[4] && !in[5] && !in[6] && !in[7]) {
|
||||
memset(out, 0, 8*sizeof(out[0]));
|
||||
@@ -673,7 +673,7 @@ void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const ui
|
||||
row4 = pitch << 2;
|
||||
row8 = pitch << 3;
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (flags[i]) {
|
||||
IVI_INV_SLANT8(in[0], in[8], in[16], in[24], in[32], in[40], in[48], in[56],
|
||||
@@ -710,7 +710,7 @@ void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const ui
|
||||
int i;
|
||||
int t0, t1, t2, t3, t4;
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (!in[0] && !in[1] && !in[2] && !in[3]) {
|
||||
memset(out, 0, 4*sizeof(out[0]));
|
||||
@@ -732,7 +732,7 @@ void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const ui
|
||||
|
||||
row2 = pitch << 1;
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (flags[i]) {
|
||||
IVI_INV_SLANT4(in[0], in[4], in[8], in[12],
|
||||
|
@@ -351,7 +351,8 @@ static int oggvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
avctx->delay = duration;
|
||||
av_assert0(!s->afq.remaining_delay);
|
||||
s->afq.frames->duration += duration;
|
||||
s->afq.frames->pts -= duration;
|
||||
if (s->afq.frames->pts != AV_NOPTS_VALUE)
|
||||
s->afq.frames->pts -= duration;
|
||||
s->afq.remaining_samples += duration;
|
||||
}
|
||||
ff_af_queue_remove(&s->afq, duration, &avpkt->pts, &avpkt->duration);
|
||||
|
@@ -343,19 +343,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
|
||||
|
||||
OPT_STR("level", x4->level);
|
||||
|
||||
if(x4->x264opts){
|
||||
const char *p= x4->x264opts;
|
||||
while(p){
|
||||
char param[256]={0}, val[256]={0};
|
||||
if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
|
||||
OPT_STR(param, "1");
|
||||
}else
|
||||
OPT_STR(param, val);
|
||||
p= strchr(p, ':');
|
||||
p+=!!p;
|
||||
}
|
||||
}
|
||||
|
||||
if (avctx->i_quant_factor > 0)
|
||||
x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor);
|
||||
|
||||
@@ -525,6 +512,19 @@ static av_cold int X264_init(AVCodecContext *avctx)
|
||||
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
|
||||
x4->params.b_repeat_headers = 0;
|
||||
|
||||
if(x4->x264opts){
|
||||
const char *p= x4->x264opts;
|
||||
while(p){
|
||||
char param[256]={0}, val[256]={0};
|
||||
if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
|
||||
OPT_STR(param, "1");
|
||||
}else
|
||||
OPT_STR(param, val);
|
||||
p= strchr(p, ':');
|
||||
p+=!!p;
|
||||
}
|
||||
}
|
||||
|
||||
if (x4->x264_params) {
|
||||
AVDictionary *dict = NULL;
|
||||
AVDictionaryEntry *en = NULL;
|
||||
|
@@ -1151,7 +1151,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
}
|
||||
|
||||
if (!Al) {
|
||||
s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss);
|
||||
s->coefs_finished[c] |= (2LL << se) - (1LL << ss);
|
||||
last_scan = !~s->coefs_finished[c];
|
||||
}
|
||||
|
||||
|
@@ -454,7 +454,7 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n)
|
||||
put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]);
|
||||
}
|
||||
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64])
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64])
|
||||
{
|
||||
int i;
|
||||
if (s->chroma_format == CHROMA_444) {
|
||||
|
@@ -56,6 +56,6 @@ void ff_mjpeg_encode_picture_trailer(MpegEncContext *s);
|
||||
void ff_mjpeg_encode_stuffing(MpegEncContext *s);
|
||||
void ff_mjpeg_encode_dc(MpegEncContext *s, int val,
|
||||
uint8_t *huff_size, uint16_t *huff_code);
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]);
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64]);
|
||||
|
||||
#endif /* AVCODEC_MJPEGENC_H */
|
||||
|
@@ -815,7 +815,7 @@ static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MSB_MASK(bits) (-1u << bits)
|
||||
#define MSB_MASK(bits) (-1u << (bits))
|
||||
|
||||
/** Generate PCM samples using the prediction filters and residual values
|
||||
* read from the data stream, and update the filter state. */
|
||||
|
@@ -96,6 +96,7 @@ struct MpegEncContext;
|
||||
*/
|
||||
typedef struct Picture{
|
||||
struct AVFrame f;
|
||||
uint8_t avframe_padding[1024]; // hack to allow linking to a avutil with larger AVFrame
|
||||
ThreadFrame tf;
|
||||
|
||||
AVBufferRef *qscale_table_buf;
|
||||
|
@@ -114,6 +114,9 @@ static int msrle_decode_frame(AVCodecContext *avctx,
|
||||
uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
|
||||
int i, j;
|
||||
|
||||
if (linesize < 0)
|
||||
return linesize;
|
||||
|
||||
for (i = 0; i < avctx->height; i++) {
|
||||
if (avctx->bits_per_coded_sample == 4) {
|
||||
for (j = 0; j < avctx->width - 1; j += 2) {
|
||||
|
@@ -84,8 +84,8 @@ void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma)
|
||||
blk[6 * step] = (-(t3 + t7) + t8 + tA) >> shift; \
|
||||
blk[7 * step] = (-(t1 + t6) + t9 + tB) >> shift; \
|
||||
|
||||
#define SOP_ROW(a) ((a) << 16) + 0x2000
|
||||
#define SOP_COL(a) ((a + 32) << 16)
|
||||
#define SOP_ROW(a) (((a) << 16) + 0x2000)
|
||||
#define SOP_COL(a) (((a) + 32) << 16)
|
||||
|
||||
void ff_mss34_dct_put(uint8_t *dst, int stride, int *block)
|
||||
{
|
||||
|
@@ -364,7 +364,7 @@ static int get_value_cached(GetBitContext *gb, int vec_pos, uint8_t *vec,
|
||||
return prev[component];
|
||||
}
|
||||
|
||||
#define MKVAL(vals) (vals[0] | (vals[1] << 3) | (vals[2] << 6))
|
||||
#define MKVAL(vals) ((vals)[0] | ((vals)[1] << 3) | ((vals)[2] << 6))
|
||||
|
||||
/* Image mode - the hardest to comprehend MSS4 coding mode.
|
||||
*
|
||||
|
@@ -682,6 +682,7 @@ int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame)
|
||||
typedef struct CompatReleaseBufPriv {
|
||||
AVCodecContext avctx;
|
||||
AVFrame frame;
|
||||
uint8_t avframe_padding[1024]; // hack to allow linking to a avutil with larger AVFrame
|
||||
} CompatReleaseBufPriv;
|
||||
|
||||
static void compat_free_buffer(void *opaque, uint8_t *data)
|
||||
@@ -1491,7 +1492,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
||||
const AVFrame *frame,
|
||||
int *got_packet_ptr)
|
||||
{
|
||||
AVFrame tmp;
|
||||
AVFrame *extended_frame = NULL;
|
||||
AVFrame *padded_frame = NULL;
|
||||
int ret;
|
||||
AVPacket user_pkt = *avpkt;
|
||||
@@ -1516,9 +1517,13 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
||||
}
|
||||
av_log(avctx, AV_LOG_WARNING, "extended_data is not set.\n");
|
||||
|
||||
tmp = *frame;
|
||||
tmp.extended_data = tmp.data;
|
||||
frame = &tmp;
|
||||
extended_frame = av_frame_alloc();
|
||||
if (!extended_frame)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
memcpy(extended_frame, frame, sizeof(AVFrame));
|
||||
extended_frame->extended_data = extended_frame->data;
|
||||
frame = extended_frame;
|
||||
}
|
||||
|
||||
/* check for valid frame size */
|
||||
@@ -1526,14 +1531,15 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
||||
if (avctx->codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) {
|
||||
if (frame->nb_samples > avctx->frame_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "more samples than frame size (avcodec_encode_audio2)\n");
|
||||
return AVERROR(EINVAL);
|
||||
ret = AVERROR(EINVAL);
|
||||
goto end;
|
||||
}
|
||||
} else if (!(avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)) {
|
||||
if (frame->nb_samples < avctx->frame_size &&
|
||||
!avctx->internal->last_audio_frame) {
|
||||
ret = pad_last_frame(avctx, &padded_frame, frame);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
goto end;
|
||||
|
||||
frame = padded_frame;
|
||||
avctx->internal->last_audio_frame = 1;
|
||||
@@ -1605,6 +1611,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
||||
|
||||
end:
|
||||
av_frame_free(&padded_frame);
|
||||
av_free(extended_frame);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -1909,9 +1909,10 @@ static void vc1_interp_mc(VC1Context *v)
|
||||
uvmx = (mx + ((mx & 3) == 3)) >> 1;
|
||||
uvmy = (my + ((my & 3) == 3)) >> 1;
|
||||
if (v->field_mode) {
|
||||
if (v->cur_field_type != v->ref_field_type[1])
|
||||
if (v->cur_field_type != v->ref_field_type[1]) {
|
||||
my = my - 2 + 4 * v->cur_field_type;
|
||||
uvmy = uvmy - 2 + 4 * v->cur_field_type;
|
||||
}
|
||||
}
|
||||
if (v->fastuvmc) {
|
||||
uvmx = uvmx + ((uvmx < 0) ? -(uvmx & 1) : (uvmx & 1));
|
||||
|
@@ -386,9 +386,9 @@ int ff_wma_end(AVCodecContext *avctx)
|
||||
}
|
||||
for (i = 0; i < 2; i++) {
|
||||
ff_free_vlc(&s->coef_vlc[i]);
|
||||
av_free(s->run_table[i]);
|
||||
av_free(s->level_table[i]);
|
||||
av_free(s->int_table[i]);
|
||||
av_freep(&s->run_table[i]);
|
||||
av_freep(&s->level_table[i]);
|
||||
av_freep(&s->int_table[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -343,7 +343,7 @@ DECLARE_ASM_CONST(16, int32_t, walkenIdctRounders)[] = {
|
||||
"movdqa %%xmm6, 4*16("dct") \n\t" \
|
||||
"movdqa "SREG2", 7*16("dct") \n\t"
|
||||
|
||||
inline void ff_idct_xvid_sse2(short *block)
|
||||
av_extern_inline void ff_idct_xvid_sse2(short *block)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"movq "MANGLE(m127)", %%mm0 \n\t"
|
||||
|
@@ -216,7 +216,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
|
||||
"psubusw "MM"1, "MM"4 \n\t"
|
||||
"packuswb "MM"4, "MM"4 \n\t"
|
||||
#if COMPILE_TEMPLATE_SSE2
|
||||
"packuswb "MM"4, "MM"4 \n\t"
|
||||
"packsswb "MM"4, "MM"4 \n\t"
|
||||
#endif
|
||||
"movd "MM"4, %0 \n\t" // *overflow
|
||||
: "=g" (*overflow)
|
||||
|
@@ -279,7 +279,7 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame)
|
||||
p2 += 8 * linesize;
|
||||
}
|
||||
emms_c();
|
||||
mafd = nb_sad ? sad / nb_sad : 0;
|
||||
mafd = nb_sad ? (double)sad / nb_sad : 0;
|
||||
diff = fabs(mafd - select->prev_mafd);
|
||||
ret = av_clipf(FFMIN(mafd, diff) / 100., 0, 1);
|
||||
select->prev_mafd = mafd;
|
||||
|
@@ -38,7 +38,7 @@ static void print_formats(AVFilterContext *filter_ctx)
|
||||
for (j = 0; j < fmts->nb_formats; j++) \
|
||||
if(av_get_pix_fmt_name(fmts->formats[j])) \
|
||||
printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
|
||||
i, filter_ctx->filter->inout##puts[i].name, \
|
||||
i, filter_ctx->inout##put_pads[i].name, \
|
||||
av_get_pix_fmt_name(fmts->formats[j])); \
|
||||
} else if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_AUDIO) { \
|
||||
AVFilterFormats *fmts; \
|
||||
@@ -47,7 +47,7 @@ static void print_formats(AVFilterContext *filter_ctx)
|
||||
fmts = filter_ctx->inout##puts[i]->outin##_formats; \
|
||||
for (j = 0; j < fmts->nb_formats; j++) \
|
||||
printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
|
||||
i, filter_ctx->filter->inout##puts[i].name, \
|
||||
i, filter_ctx->inout##put_pads[i].name, \
|
||||
av_get_sample_fmt_name(fmts->formats[j])); \
|
||||
\
|
||||
layouts = filter_ctx->inout##puts[i]->outin##_channel_layouts; \
|
||||
@@ -56,7 +56,7 @@ static void print_formats(AVFilterContext *filter_ctx)
|
||||
av_get_channel_layout_string(buf, sizeof(buf), -1, \
|
||||
layouts->channel_layouts[j]); \
|
||||
printf(#INOUT "PUT[%d] %s: chlayout:%s\n", \
|
||||
i, filter_ctx->filter->inout##puts[i].name, buf); \
|
||||
i, filter_ctx->inout##put_pads[i].name, buf); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
@@ -106,12 +106,12 @@ int main(int argc, char **argv)
|
||||
/* create a link for each of the input pads */
|
||||
for (i = 0; i < filter_ctx->input_count; i++) {
|
||||
AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
|
||||
link->type = filter_ctx->filter->inputs[i].type;
|
||||
link->type = filter_ctx->input_pads[i].type;
|
||||
filter_ctx->inputs[i] = link;
|
||||
}
|
||||
for (i = 0; i < filter_ctx->output_count; i++) {
|
||||
AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
|
||||
link->type = filter_ctx->filter->outputs[i].type;
|
||||
link->type = filter_ctx->output_pads[i].type;
|
||||
filter_ctx->outputs[i] = link;
|
||||
}
|
||||
|
||||
|
@@ -31,9 +31,10 @@ static int print_link_prop(AVBPrint *buf, AVFilterLink *link)
|
||||
{
|
||||
char *format;
|
||||
char layout[64];
|
||||
AVBPrint dummy_buffer = { 0 };
|
||||
|
||||
if (!buf)
|
||||
buf = &(AVBPrint){ 0 }; /* dummy buffer */
|
||||
buf = &dummy_buffer;
|
||||
switch (link->type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
format = av_x_if_null(av_get_pix_fmt_name(link->format), "?");
|
||||
|
@@ -306,8 +306,8 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
|
||||
//av_log(NULL, AV_LOG_ERROR, "\n");
|
||||
}
|
||||
|
||||
p_x = (center_x - width / 2);
|
||||
p_y = (center_y - height / 2);
|
||||
p_x = (center_x - width / 2.0);
|
||||
p_y = (center_y - height / 2.0);
|
||||
t->vector.x += (cos(t->angle)-1)*p_x - sin(t->angle)*p_y;
|
||||
t->vector.y += sin(t->angle)*p_x + (cos(t->angle)-1)*p_y;
|
||||
|
||||
|
@@ -61,7 +61,7 @@ static int cavsvideo_probe(AVProbeData *p)
|
||||
}
|
||||
}
|
||||
if(seq && seq*9<=pic*10)
|
||||
return AVPROBE_SCORE_EXTENSION;
|
||||
return AVPROBE_SCORE_EXTENSION+1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -223,6 +223,18 @@ static int flv_write_header(AVFormatContext *s)
|
||||
avcodec_get_name(enc->codec_id), i);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (enc->codec_id == AV_CODEC_ID_MPEG4 ||
|
||||
enc->codec_id == AV_CODEC_ID_H263) {
|
||||
int error = enc->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL;
|
||||
av_log(s, error ? AV_LOG_ERROR : AV_LOG_WARNING,
|
||||
"Codec %s is not supported in the official FLV specification,\n", avcodec_get_name(enc->codec_id));
|
||||
|
||||
if (error) {
|
||||
av_log(s, AV_LOG_ERROR,
|
||||
"use vstrict=-1 / -strict -1 to use it anyway.\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
if (audio_enc) {
|
||||
|
@@ -35,7 +35,7 @@ static int h263_probe(AVProbeData *p)
|
||||
for(i=0; i<p->buf_size; i++){
|
||||
code = (code<<8) + p->buf[i];
|
||||
if ((code & 0xfffffc0000) == 0x800000) {
|
||||
src_fmt= (code>>2)&3;
|
||||
src_fmt= (code>>2)&7;
|
||||
if( src_fmt != last_src_fmt
|
||||
&& last_src_fmt>0 && last_src_fmt<6
|
||||
&& src_fmt<6)
|
||||
|
@@ -1697,7 +1697,7 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
if (!entries)
|
||||
{
|
||||
sc->keyframe_absent = 1;
|
||||
if (!st->need_parsing)
|
||||
if (!st->need_parsing && st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
|
||||
st->need_parsing = AVSTREAM_PARSE_HEADERS;
|
||||
return 0;
|
||||
}
|
||||
@@ -2054,6 +2054,11 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
||||
rap_group_index++;
|
||||
}
|
||||
}
|
||||
if (sc->keyframe_absent
|
||||
&& !sc->stps_count
|
||||
&& !rap_group_present
|
||||
&& st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
keyframe = 1;
|
||||
if (keyframe)
|
||||
distance = 0;
|
||||
sample_size = sc->stsz_sample_size > 0 ? sc->stsz_sample_size : sc->sample_sizes[current_sample];
|
||||
|
@@ -418,14 +418,14 @@ static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
if (mp3->pics_to_write) {
|
||||
/* buffer audio packets until we get all the pictures */
|
||||
AVPacketList *pktl = av_mallocz(sizeof(*pktl));
|
||||
int ret;
|
||||
if (!pktl)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
pktl->pkt = *pkt;
|
||||
pktl->pkt.buf = av_buffer_ref(pkt->buf);
|
||||
if (!pktl->pkt.buf) {
|
||||
ret = av_copy_packet(&pktl->pkt, pkt);
|
||||
if (ret < 0) {
|
||||
av_freep(&pktl);
|
||||
return AVERROR(ENOMEM);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (mp3->queue_end)
|
||||
|
@@ -153,7 +153,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
}
|
||||
c->curbits = (curbits + size2) & 0x1F;
|
||||
|
||||
if ((ret = av_new_packet(pkt, size)) < 0)
|
||||
if ((ret = av_new_packet(pkt, size + 4)) < 0)
|
||||
return ret;
|
||||
|
||||
pkt->data[0] = curbits;
|
||||
|
@@ -1268,7 +1268,7 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, int section_le
|
||||
AVStream *st;
|
||||
if (ts->pids[pid]->es_id != mp4_descr[i].es_id)
|
||||
continue;
|
||||
if (!(ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES)) {
|
||||
if (ts->pids[pid]->type != MPEGTS_PES) {
|
||||
av_log(s, AV_LOG_ERROR, "pid %x is not PES\n", pid);
|
||||
continue;
|
||||
}
|
||||
|
@@ -420,6 +420,12 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
|
||||
av_dlog(s, "compute_pkt_fields2: pts:%s dts:%s cur_dts:%s b:%d size:%d st:%d\n",
|
||||
av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), delay, pkt->size, pkt->stream_index);
|
||||
|
||||
if (pkt->duration < 0 && st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) {
|
||||
av_log(s, AV_LOG_WARNING, "Packet with invalid duration %d in stream %d\n",
|
||||
pkt->duration, pkt->stream_index);
|
||||
pkt->duration = 0;
|
||||
}
|
||||
|
||||
/* duration field */
|
||||
if (pkt->duration == 0) {
|
||||
ff_compute_frame_duration(&num, &den, st, NULL, pkt);
|
||||
|
@@ -45,6 +45,24 @@
|
||||
static int flags, checked;
|
||||
|
||||
void av_force_cpu_flags(int arg){
|
||||
if ( (arg & ( AV_CPU_FLAG_3DNOW |
|
||||
AV_CPU_FLAG_3DNOWEXT |
|
||||
AV_CPU_FLAG_SSE |
|
||||
AV_CPU_FLAG_SSE2 |
|
||||
AV_CPU_FLAG_SSE2SLOW |
|
||||
AV_CPU_FLAG_SSE3 |
|
||||
AV_CPU_FLAG_SSE3SLOW |
|
||||
AV_CPU_FLAG_SSSE3 |
|
||||
AV_CPU_FLAG_SSE4 |
|
||||
AV_CPU_FLAG_SSE42 |
|
||||
AV_CPU_FLAG_AVX |
|
||||
AV_CPU_FLAG_XOP |
|
||||
AV_CPU_FLAG_FMA4 ))
|
||||
&& !(arg & AV_CPU_FLAG_MMX)) {
|
||||
av_log(NULL, AV_LOG_WARNING, "MMX implied by specified flags\n");
|
||||
arg |= AV_CPU_FLAG_MMX;
|
||||
}
|
||||
|
||||
flags = arg;
|
||||
checked = arg != -1;
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "avutil.h"
|
||||
#include "avassert.h"
|
||||
#include "common.h"
|
||||
#include "intreadwrite.h"
|
||||
#include "lzo.h"
|
||||
@@ -65,8 +66,13 @@ static inline int get_len(LZOContext *c, int x, int mask)
|
||||
{
|
||||
int cnt = x & mask;
|
||||
if (!cnt) {
|
||||
while (!(x = get_byte(c)))
|
||||
while (!(x = get_byte(c))) {
|
||||
if (cnt >= INT_MAX - 1000) {
|
||||
c->error |= AV_LZO_ERROR;
|
||||
break;
|
||||
}
|
||||
cnt += 255;
|
||||
}
|
||||
cnt += mask + x;
|
||||
}
|
||||
return cnt;
|
||||
@@ -80,6 +86,7 @@ static inline void copy(LZOContext *c, int cnt)
|
||||
{
|
||||
register const uint8_t *src = c->in;
|
||||
register uint8_t *dst = c->out;
|
||||
av_assert0(cnt >= 0);
|
||||
if (cnt > c->in_end - src) {
|
||||
cnt = FFMAX(c->in_end - src, 0);
|
||||
c->error |= AV_LZO_INPUT_DEPLETED;
|
||||
@@ -111,6 +118,7 @@ static inline void copy(LZOContext *c, int cnt)
|
||||
static inline void copy_backptr(LZOContext *c, int back, int cnt)
|
||||
{
|
||||
register uint8_t *dst = c->out;
|
||||
av_assert0(cnt > 0);
|
||||
if (dst - c->out_start < back) {
|
||||
c->error |= AV_LZO_INVALID_BACKPTR;
|
||||
return;
|
||||
|
@@ -1430,8 +1430,10 @@ void av_opt_freep_ranges(AVOptionRanges **rangesp)
|
||||
|
||||
for (i = 0; i < ranges->nb_ranges; i++) {
|
||||
AVOptionRange *range = ranges->range[i];
|
||||
av_freep(&range->str);
|
||||
av_freep(&ranges->range[i]);
|
||||
if (range) {
|
||||
av_freep(&range->str);
|
||||
av_freep(&ranges->range[i]);
|
||||
}
|
||||
}
|
||||
av_freep(&ranges->range);
|
||||
av_freep(rangesp);
|
||||
|
@@ -26,6 +26,10 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64)
|
||||
#error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS
|
||||
#endif
|
||||
|
||||
#define AV_TS_MAX_STRING_SIZE 32
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,7 @@
|
||||
void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt) {
|
||||
double scale = s->dither.noise_scale;
|
||||
#define TMP_EXTRA 2
|
||||
double *tmp = av_malloc((len + TMP_EXTRA) * sizeof(double));
|
||||
double *tmp = av_malloc_array(len + TMP_EXTRA, sizeof(double));
|
||||
int i;
|
||||
|
||||
for(i=0; i<len + TMP_EXTRA; i++){
|
||||
|
@@ -126,6 +126,11 @@ av_cold static int auto_matrix(SwrContext *s)
|
||||
)
|
||||
out_ch_layout = AV_CH_LAYOUT_STEREO;
|
||||
|
||||
if( in_ch_layout == AV_CH_LAYOUT_STEREO_DOWNMIX
|
||||
&& (out_ch_layout & AV_CH_LAYOUT_STEREO_DOWNMIX) == 0
|
||||
)
|
||||
in_ch_layout = AV_CH_LAYOUT_STEREO;
|
||||
|
||||
if(!sane_layout(in_ch_layout)){
|
||||
av_get_channel_layout_string(buf, sizeof(buf), -1, s->in_ch_layout);
|
||||
av_log(s, AV_LOG_ERROR, "Input channel layout '%s' is not supported\n", buf);
|
||||
|
@@ -95,7 +95,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
|
||||
int filter_type, int kaiser_beta){
|
||||
int ph, i;
|
||||
double x, y, w;
|
||||
double *tab = av_malloc(tap_count * sizeof(*tab));
|
||||
double *tab = av_malloc_array(tap_count, sizeof(*tab));
|
||||
const int center= (tap_count-1)/2;
|
||||
|
||||
if (!tab)
|
||||
@@ -229,6 +229,11 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r
|
||||
av_assert0(0);
|
||||
}
|
||||
|
||||
if (filter_size/factor > INT32_MAX/256) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Filter length too large\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
c->phase_shift = phase_shift;
|
||||
c->phase_mask = phase_count - 1;
|
||||
c->linear = linear;
|
||||
|
@@ -208,8 +208,9 @@ static void lumRangeToJpeg16_c(int16_t *_dst, int width)
|
||||
{
|
||||
int i;
|
||||
int32_t *dst = (int32_t *) _dst;
|
||||
for (i = 0; i < width; i++)
|
||||
dst[i] = (FFMIN(dst[i], 30189 << 4) * 4769 - (39057361 << 2)) >> 12;
|
||||
for (i = 0; i < width; i++) {
|
||||
dst[i] = ((int)(FFMIN(dst[i], 30189 << 4) * 4769U - (39057361 << 2))) >> 12;
|
||||
}
|
||||
}
|
||||
|
||||
static void lumRangeFromJpeg16_c(int16_t *_dst, int width)
|
||||
@@ -865,7 +866,7 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
|
||||
uint8_t *dst2[4];
|
||||
uint8_t *rgb0_tmp = NULL;
|
||||
|
||||
if (!srcSlice || !dstStride || !dst || !srcSlice) {
|
||||
if (!srcStride || !dstStride || !dst || !srcSlice) {
|
||||
av_log(c, AV_LOG_ERROR, "One of the input parameters to sws_scale() is NULL, please check the calling code\n");
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1184,7 +1184,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
|
||||
c->swScale = ff_yuv2rgb_get_func_ptr(c);
|
||||
}
|
||||
|
||||
if (srcFormat == AV_PIX_FMT_YUV410P &&
|
||||
if (srcFormat == AV_PIX_FMT_YUV410P && !(dstH & 3) &&
|
||||
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
|
||||
!(flags & SWS_BITEXACT)) {
|
||||
c->swScale = yvu9ToYv12Wrapper;
|
||||
|
@@ -266,7 +266,8 @@ static void yuv2yuvX_sse3(const int16_t *filter, int filterSize,
|
||||
"jb 1b \n\t"\
|
||||
:: "g" (filter),
|
||||
"r" (dest-offset), "g" ((x86_reg)(dstW+offset)), "m" (offset)
|
||||
: "%"REG_d, "%"REG_S, "%"REG_c
|
||||
: XMM_CLOBBERS("%xmm0" , "%xmm1" , "%xmm2" , "%xmm3" , "%xmm4" , "%xmm5" , "%xmm7" ,)
|
||||
"%"REG_d, "%"REG_S, "%"REG_c
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
@@ -332,7 +332,7 @@ static void RENAME(yuv2yuvX)(const int16_t *filter, int filterSize,
|
||||
MOVNTQ( q3, 24(dst, index, 4))\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
#define WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t)
|
||||
|
||||
@@ -358,13 +358,13 @@ static void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
"psraw $3, %%mm1 \n\t"
|
||||
"psraw $3, %%mm7 \n\t"
|
||||
"packuswb %%mm7, %%mm1 \n\t"
|
||||
WRITEBGR32(%4, %5, %%REGa, %%mm3, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm2, %%mm6)
|
||||
WRITEBGR32(%4, "%5", %%REGa, %%mm3, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm2, %%mm6)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
} else {
|
||||
YSCALEYUV2PACKEDX_ACCURATE
|
||||
YSCALEYUV2RGBX
|
||||
"pcmpeqd %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%4, "%5", %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
}
|
||||
@@ -387,13 +387,13 @@ static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"psraw $3, %%mm1 \n\t"
|
||||
"psraw $3, %%mm7 \n\t"
|
||||
"packuswb %%mm7, %%mm1 \n\t"
|
||||
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
WRITEBGR32(%4, "%5", %%REGa, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
} else {
|
||||
YSCALEYUV2PACKEDX
|
||||
YSCALEYUV2RGBX
|
||||
"pcmpeqd %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%4, "%5", %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
}
|
||||
@@ -422,7 +422,7 @@ static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
MOVNTQ(%%mm1, 8(dst, index, 2))\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
#define WRITERGB16(dst, dstw, index) REAL_WRITERGB16(dst, dstw, index)
|
||||
|
||||
@@ -446,7 +446,7 @@ static void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
"paddusb "GREEN_DITHER"(%0), %%mm4\n\t"
|
||||
"paddusb "RED_DITHER"(%0), %%mm5\n\t"
|
||||
#endif
|
||||
WRITERGB16(%4, %5, %%REGa)
|
||||
WRITERGB16(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"paddusb "GREEN_DITHER"(%0), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%0), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB16(%4, %5, %%REGa)
|
||||
WRITERGB16(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
MOVNTQ(%%mm1, 8(dst, index, 2))\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
#define WRITERGB15(dst, dstw, index) REAL_WRITERGB15(dst, dstw, index)
|
||||
|
||||
@@ -523,7 +523,7 @@ static void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
"paddusb "GREEN_DITHER"(%0), %%mm4\n\t"
|
||||
"paddusb "RED_DITHER"(%0), %%mm5\n\t"
|
||||
#endif
|
||||
WRITERGB15(%4, %5, %%REGa)
|
||||
WRITERGB15(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"paddusb "GREEN_DITHER"(%0), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%0), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB15(%4, %5, %%REGa)
|
||||
WRITERGB15(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"add $24, "#dst" \n\t"\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
|
||||
#define WRITEBGR24MMXEXT(dst, dstw, index) \
|
||||
@@ -649,7 +649,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"add $24, "#dst" \n\t"\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
|
||||
#if COMPILE_TEMPLATE_MMXEXT
|
||||
@@ -676,7 +676,7 @@ static void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_c"\n\t" //FIXME optimize
|
||||
"add %4, %%"REG_c" \n\t"
|
||||
WRITEBGR24(%%REGc, %5, %%REGa)
|
||||
WRITEBGR24(%%REGc, "%5", %%REGa)
|
||||
:: "r" (&c->redDither),
|
||||
"m" (dummy), "m" (dummy), "m" (dummy),
|
||||
"r" (dest), "m" (dstW_reg), "m"(uv_off)
|
||||
@@ -700,7 +700,7 @@ static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_c" \n\t" //FIXME optimize
|
||||
"add %4, %%"REG_c" \n\t"
|
||||
WRITEBGR24(%%REGc, %5, %%REGa)
|
||||
WRITEBGR24(%%REGc, "%5", %%REGa)
|
||||
:: "r" (&c->redDither),
|
||||
"m" (dummy), "m" (dummy), "m" (dummy),
|
||||
"r" (dest), "m" (dstW_reg), "m"(uv_off)
|
||||
@@ -721,7 +721,7 @@ static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
MOVNTQ(%%mm7, 8(dst, index, 2))\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
#define WRITEYUY2(dst, dstw, index) REAL_WRITEYUY2(dst, dstw, index)
|
||||
|
||||
@@ -742,7 +742,7 @@ static void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
"psraw $3, %%mm4 \n\t"
|
||||
"psraw $3, %%mm1 \n\t"
|
||||
"psraw $3, %%mm7 \n\t"
|
||||
WRITEYUY2(%4, %5, %%REGa)
|
||||
WRITEYUY2(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -763,7 +763,7 @@ static void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"psraw $3, %%mm4 \n\t"
|
||||
"psraw $3, %%mm1 \n\t"
|
||||
"psraw $3, %%mm7 \n\t"
|
||||
WRITEYUY2(%4, %5, %%REGa)
|
||||
WRITEYUY2(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@ static void RENAME(yuv2rgb32_2)(SwsContext *c, const int16_t *buf[2],
|
||||
"psraw $3, %%mm1 \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
|
||||
"psraw $3, %%mm7 \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
|
||||
"packuswb %%mm7, %%mm1 \n\t"
|
||||
WRITEBGR32(%4, 8280(%5), %%r8, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
WRITEBGR32(%4, DSTW_OFFSET"(%5)", %%r8, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "r" (dest),
|
||||
"a" (&c->redDither),
|
||||
"r" (abuf0), "r" (abuf1)
|
||||
@@ -888,7 +888,7 @@ static void RENAME(yuv2rgb32_2)(SwsContext *c, const int16_t *buf[2],
|
||||
"packuswb %%mm7, %%mm1 \n\t"
|
||||
"pop %1 \n\t"
|
||||
"pop %0 \n\t"
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -902,7 +902,7 @@ static void RENAME(yuv2rgb32_2)(SwsContext *c, const int16_t *buf[2],
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB(%%REGBP, %5)
|
||||
"pcmpeqd %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -919,14 +919,13 @@ static void RENAME(yuv2bgr24_2)(SwsContext *c, const int16_t *buf[2],
|
||||
const int16_t *buf0 = buf[0], *buf1 = buf[1],
|
||||
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
|
||||
|
||||
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
|
||||
__asm__ volatile(
|
||||
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB(%%REGBP, %5)
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEBGR24(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -942,7 +941,6 @@ static void RENAME(yuv2rgb555_2)(SwsContext *c, const int16_t *buf[2],
|
||||
const int16_t *buf0 = buf[0], *buf1 = buf[1],
|
||||
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
|
||||
|
||||
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
|
||||
__asm__ volatile(
|
||||
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
@@ -955,7 +953,7 @@ static void RENAME(yuv2rgb555_2)(SwsContext *c, const int16_t *buf[2],
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB15(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -971,7 +969,6 @@ static void RENAME(yuv2rgb565_2)(SwsContext *c, const int16_t *buf[2],
|
||||
const int16_t *buf0 = buf[0], *buf1 = buf[1],
|
||||
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
|
||||
|
||||
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
|
||||
__asm__ volatile(
|
||||
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
@@ -984,7 +981,7 @@ static void RENAME(yuv2rgb565_2)(SwsContext *c, const int16_t *buf[2],
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB16(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB16(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1040,13 +1037,12 @@ static void RENAME(yuv2yuyv422_2)(SwsContext *c, const int16_t *buf[2],
|
||||
const int16_t *buf0 = buf[0], *buf1 = buf[1],
|
||||
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
|
||||
|
||||
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
|
||||
__asm__ volatile(
|
||||
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2PACKED(%%REGBP, %5)
|
||||
WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEYUY2(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1189,7 +1185,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1(%%REGBP, %5)
|
||||
YSCALEYUV2RGB1_ALPHA(%%REGBP)
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (abuf0), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1202,7 +1198,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1(%%REGBP, %5)
|
||||
"pcmpeqd %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1218,7 +1214,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1b(%%REGBP, %5)
|
||||
YSCALEYUV2RGB1_ALPHA(%%REGBP)
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (abuf0), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1231,7 +1227,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1b(%%REGBP, %5)
|
||||
"pcmpeqd %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1257,7 +1253,7 @@ static void RENAME(yuv2bgr24_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1(%%REGBP, %5)
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEBGR24(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1271,7 +1267,7 @@ static void RENAME(yuv2bgr24_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1b(%%REGBP, %5)
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEBGR24(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1302,7 +1298,7 @@ static void RENAME(yuv2rgb555_1)(SwsContext *c, const int16_t *buf0,
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB15(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1322,7 +1318,7 @@ static void RENAME(yuv2rgb555_1)(SwsContext *c, const int16_t *buf0,
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB15(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1353,7 +1349,7 @@ static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0,
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB16(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB16(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1373,7 +1369,7 @@ static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0,
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB16(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB16(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1434,7 +1430,7 @@ static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0,
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2PACKED1(%%REGBP, %5)
|
||||
WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEYUY2(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1447,7 +1443,7 @@ static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0,
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2PACKED1b(%%REGBP, %5)
|
||||
WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEYUY2(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
|
@@ -1,10 +1,10 @@
|
||||
pkt_pts=1620|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=4140|tag:lavfi.scene_score=0.880000
|
||||
pkt_pts=4140|tag:lavfi.scene_score=0.876620
|
||||
pkt_pts=5800|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=6720|tag:lavfi.scene_score=0.460000
|
||||
pkt_pts=6720|tag:lavfi.scene_score=0.463258
|
||||
pkt_pts=8160|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=9760|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=14080|tag:lavfi.scene_score=0.840000
|
||||
pkt_pts=14080|tag:lavfi.scene_score=0.842022
|
||||
pkt_pts=15700|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=18500|tag:lavfi.scene_score=0.470000
|
||||
pkt_pts=18500|tag:lavfi.scene_score=0.471341
|
||||
pkt_pts=21760|tag:lavfi.scene_score=1.000000
|
||||
|
@@ -1,31 +1,31 @@
|
||||
#tb 0: 1/25
|
||||
0, 0, 0, 1, 518400, 0x89407f55
|
||||
0, 2, 2, 1, 518400, 0x8611849c
|
||||
0, 2, 2, 1, 518400, 0xaa896afd
|
||||
0, 3, 3, 1, 518400, 0x0e69ff59
|
||||
0, 4, 4, 1, 518400, 0xf31adb03
|
||||
0, 4, 4, 1, 518400, 0x0c30bfa0
|
||||
0, 5, 5, 1, 518400, 0x1a5b6a69
|
||||
0, 6, 6, 1, 518400, 0x6ae6232e
|
||||
0, 6, 6, 1, 518400, 0x23470858
|
||||
0, 7, 7, 1, 518400, 0x9a4e3c54
|
||||
0, 8, 8, 1, 518400, 0xe5852b45
|
||||
0, 8, 8, 1, 518400, 0xad63160b
|
||||
0, 9, 9, 1, 518400, 0x0fcfeebc
|
||||
0, 10, 10, 1, 518400, 0x06e22dc3
|
||||
0, 10, 10, 1, 518400, 0x20b31777
|
||||
0, 11, 11, 1, 518400, 0x9d79df09
|
||||
0, 12, 12, 1, 518400, 0xcb2c716f
|
||||
0, 12, 12, 1, 518400, 0x3e86766f
|
||||
0, 13, 13, 1, 518400, 0x638a8746
|
||||
0, 14, 14, 1, 518400, 0xf7032efd
|
||||
0, 14, 14, 1, 518400, 0x7a6c1a0e
|
||||
0, 15, 15, 1, 518400, 0x306f6cef
|
||||
0, 16, 16, 1, 518400, 0xe83d2518
|
||||
0, 16, 16, 1, 518400, 0x81f81281
|
||||
0, 17, 17, 1, 518400, 0x49ab5bf5
|
||||
0, 18, 18, 1, 518400, 0x6b336b6f
|
||||
0, 18, 18, 1, 518400, 0x8f316e44
|
||||
0, 19, 19, 1, 518400, 0x95ae00c9
|
||||
0, 20, 20, 1, 518400, 0x68ddb64f
|
||||
0, 20, 20, 1, 518400, 0xf71bb7f5
|
||||
0, 21, 21, 1, 518400, 0x5205ea68
|
||||
0, 22, 22, 1, 518400, 0xb088e617
|
||||
0, 22, 22, 1, 518400, 0x74a1d8b9
|
||||
0, 23, 23, 1, 518400, 0xa3217616
|
||||
0, 24, 24, 1, 518400, 0x1723bc53
|
||||
0, 24, 24, 1, 518400, 0x2b28bbf8
|
||||
0, 25, 25, 1, 518400, 0xf024872a
|
||||
0, 26, 26, 1, 518400, 0x2e81a8bb
|
||||
0, 26, 26, 1, 518400, 0x2fdbaaf3
|
||||
0, 27, 27, 1, 518400, 0xa3a2418e
|
||||
0, 28, 28, 1, 518400, 0xb7beffed
|
||||
0, 28, 28, 1, 518400, 0x55bfe435
|
||||
0, 29, 29, 1, 518400, 0x50fb6c94
|
||||
0, 30, 30, 1, 518400, 0x5584bb40
|
||||
|
Reference in New Issue
Block a user