Compare commits
49 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 71fb613263 | |||
| c3ad886251 | |||
| 6f1b402e31 | |||
| 268c460c97 | |||
| e5a261e93d | |||
| 00c2073071 | |||
| 4d82b7bac4 | |||
| c513bd4803 | |||
| a56d3a1ef1 | |||
| 4bcb493a0e | |||
| 3392936e82 | |||
| ea238698bc | |||
| ad28b01a14 | |||
| fa20129765 | |||
| 0f6580b169 | |||
| 4c34976fea | |||
| 8b84cffb30 | |||
| bc9e149c2a | |||
| 0c5f3c230a | |||
| 545cfeeebd | |||
| 3eaf65305e | |||
| 73eb9578c1 | |||
| f97265961e | |||
| 773d1b857b | |||
| 261ff2e208 | |||
| 8478879af6 | |||
| e243076b32 | |||
| e5a88d62b6 | |||
| 2ae1a70cd5 | |||
| 68da8e9703 | |||
| 2a47fecb09 | |||
| 9f828f147b | |||
| fdff97fe47 | |||
| 79afac279b | |||
| 04b48cefac | |||
| 7436138621 | |||
| b314170e2b | |||
| 3f4ec2d6af | |||
| 0891a36dd8 | |||
| 383a51855a | |||
| 37aaa56842 | |||
| a73cd6aebf | |||
| 2177cc8eb8 | |||
| a16aaae628 | |||
| 3f28c576e0 | |||
| d585a0a1cc | |||
| b48951bd29 | |||
| a54187b7d9 | |||
| a1f13b592b |
@@ -1,6 +1,6 @@
|
||||
See the Git history of the project (git://source.ffmpeg.org/ffmpeg) to
|
||||
See the Git history of the project (https://git.ffmpeg.org/ffmpeg) to
|
||||
get the names of people who have contributed to FFmpeg.
|
||||
|
||||
To check the log, you can type the command "git log" in the FFmpeg
|
||||
source directory, or browse the online repository at
|
||||
http://source.ffmpeg.org.
|
||||
https://git.ffmpeg.org/ffmpeg
|
||||
|
||||
@@ -1,6 +1,55 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 4.4.4:
|
||||
- avcodec/tests/snowenc: Fix 2nd test
|
||||
- avcodec/tests/snowenc: return a failure if DWT/IDWT mismatches
|
||||
- avcodec/snowenc: Fix visual weight calculation
|
||||
- avcodec/tests/snowenc: unbreak DWT tests
|
||||
- avcodec/vp3: Add missing check for av_malloc
|
||||
- avformat/nutdec: Add check for avformat_new_stream
|
||||
- avcodec/mpeg12dec: Check input size
|
||||
- avcodec/escape124: Fix some return codes
|
||||
- avcodec/escape124: fix signdness of end of input check
|
||||
- Use https for repository links
|
||||
- avcodec/rpzaenc: stop accessing out of bounds frame
|
||||
- avcodec/motionpixels: Mask pixels to valid values
|
||||
- avcodec/xpmdec: Check size before allocation to avoid truncation
|
||||
- avcodec/bink: Avoid undefined out of array end pointers in binkb_decode_plane()
|
||||
- avcodec/bink: Fix off by 1 error in ref end
|
||||
- avcodec/utils: Ensure linesize for SVQ3
|
||||
- avcodec/utils: allocate a line more for VC1 and WMV3
|
||||
- avcodec/videodsp_template: Adjust pointers to avoid undefined pointer things
|
||||
- avcodec/pngdec: Check deloco index more exactly
|
||||
- avcodec/ffv1dec: Check that num h/v slices is supported
|
||||
- avformat/mov: Check samplesize and offset to avoid integer overflow
|
||||
- avcodec/pictordec: Remove mid exit branch
|
||||
- avcodec/eac3dec: avoid float noise in fixed mode addition to overflow
|
||||
- avcodec/utils: use 32pixel alignment for bink
|
||||
- avcodec/scpr3: Check bx
|
||||
- avcodec/012v: Order operations for odd size handling
|
||||
- avcodec/eatgq: : Check index increments in tgq_decode_block()
|
||||
- avcodec/scpr: Test bx before use
|
||||
- avformat/mxfdec: Use 64bit in remainder
|
||||
- avcodec/sunrast: Fix maplength check
|
||||
- avcodec/wavpack: Avoid undefined shift in get_tail()
|
||||
- avcodec/wavpack: Check for end of input in wv_unpack_dsd_high()
|
||||
- avformat/id3v2: Check taglen in read_uslt()
|
||||
- avcodec/tiff: Ignore tile_count
|
||||
- avcodec/ffv1dec: restructure slice coordinate reading a bit
|
||||
- avcodec/mlpdec: Check max matrix instead of max channel in noise check
|
||||
- swscale/input: Use more unsigned intermediates
|
||||
- avcodec/alsdec: The minimal block is at least 7 bits
|
||||
- avformat/replaygain: avoid undefined / negative abs
|
||||
- swscale/output: Bias 16bps output calculations to improve non overflowing range
|
||||
- avcodec/speedhq: Check buf_size to be big enough for DC
|
||||
- avcodec/ffv1dec: Fail earlier if prior context is corrupted
|
||||
- avcodec/nvenc: fix b-frame DTS behavior with fractional framerates
|
||||
- avfilter/vf_untile: swap the chroma shift values used for plane offsets
|
||||
- avcodec/nvenc: fix vbv buffer size in cq mode
|
||||
- avcodec/mjpegenc: take into account component count when writing the SOF header size
|
||||
- swscale: aarch64: Fix yuv2rgb with negative stride
|
||||
|
||||
version 4.4.3:
|
||||
- avformat/vividas: Check packet size
|
||||
- configure: link to libatomic when it's present
|
||||
|
||||
@@ -7591,7 +7591,7 @@ cat > $TMPH <<EOF
|
||||
#define FFMPEG_CONFIG_H
|
||||
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
|
||||
#define FFMPEG_LICENSE "$(c_escape $license)"
|
||||
#define CONFIG_THIS_YEAR 2022
|
||||
#define CONFIG_THIS_YEAR 2023
|
||||
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
|
||||
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
|
||||
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 4.4.3
|
||||
PROJECT_NUMBER = 4.4.4
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@
|
||||
The FFmpeg developers.
|
||||
|
||||
For details about the authorship, see the Git history of the project
|
||||
(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
@command{git log} in the FFmpeg source directory, or browsing the
|
||||
online repository at @url{http://source.ffmpeg.org}.
|
||||
online repository at @url{https://git.ffmpeg.org/ffmpeg}.
|
||||
|
||||
Maintainers for the specific components are listed in the file
|
||||
@file{MAINTAINERS} in the source code tree.
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ Most distribution and operating system provide a package for it.
|
||||
@section Cloning the source tree
|
||||
|
||||
@example
|
||||
git clone git://source.ffmpeg.org/ffmpeg <target>
|
||||
git clone https://git.ffmpeg.org/ffmpeg.git <target>
|
||||
@end example
|
||||
|
||||
This will put the FFmpeg sources into the directory @var{<target>}.
|
||||
|
||||
+2
-2
@@ -131,8 +131,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
u = x/2 + (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = x/2 + (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
memcpy(y, y_temp, sizeof(*y) * (width - x));
|
||||
memcpy(u, u_temp, sizeof(*u) * (width - x + 1) / 2);
|
||||
memcpy(v, v_temp, sizeof(*v) * (width - x + 1) / 2);
|
||||
memcpy(u, u_temp, sizeof(*u) * ((width - x + 1) / 2));
|
||||
memcpy(v, v_temp, sizeof(*v) * ((width - x + 1) / 2));
|
||||
}
|
||||
|
||||
line_end += stride;
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
#define AC3_DYNAMIC_RANGE1 0
|
||||
|
||||
typedef int INTFLOAT;
|
||||
typedef unsigned int UINTFLOAT;
|
||||
typedef int16_t SHORTFLOAT;
|
||||
|
||||
#else /* USE_FIXED */
|
||||
@@ -93,6 +94,7 @@ typedef int16_t SHORTFLOAT;
|
||||
#define AC3_DYNAMIC_RANGE1 1.0f
|
||||
|
||||
typedef float INTFLOAT;
|
||||
typedef float UINTFLOAT;
|
||||
typedef float SHORTFLOAT;
|
||||
|
||||
#endif /* USE_FIXED */
|
||||
|
||||
+1
-1
@@ -1017,7 +1017,7 @@ static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
|
||||
|
||||
*bd->shift_lsbs = 0;
|
||||
|
||||
if (get_bits_left(gb) < 1)
|
||||
if (get_bits_left(gb) < 7)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
// read block type flag and read the samples accordingly
|
||||
|
||||
+4
-4
@@ -869,7 +869,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
||||
|
||||
binkb_init_bundles(c);
|
||||
ref_start = frame->data[plane_idx];
|
||||
ref_end = frame->data[plane_idx] + (bh * frame->linesize[plane_idx] + bw) * 8;
|
||||
ref_end = frame->data[plane_idx] + ((bh - 1) * frame->linesize[plane_idx] + bw - 1) * 8;
|
||||
|
||||
for (i = 0; i < 64; i++)
|
||||
coordmap[i] = (i & 7) + (i >> 3) * stride;
|
||||
@@ -925,7 +925,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
||||
xoff = binkb_get_value(c, BINKB_SRC_X_OFF);
|
||||
yoff = binkb_get_value(c, BINKB_SRC_Y_OFF) + ybias;
|
||||
ref = dst + xoff + yoff * stride;
|
||||
if (ref < ref_start || ref + 8*stride > ref_end) {
|
||||
if (ref < ref_start || ref > ref_end) {
|
||||
av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n");
|
||||
} else if (ref + 8*stride < dst || ref >= dst + 8*stride) {
|
||||
c->put_pixels_tab(dst, ref, stride, 8);
|
||||
@@ -941,7 +941,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
||||
xoff = binkb_get_value(c, BINKB_SRC_X_OFF);
|
||||
yoff = binkb_get_value(c, BINKB_SRC_Y_OFF) + ybias;
|
||||
ref = dst + xoff + yoff * stride;
|
||||
if (ref < ref_start || ref + 8 * stride > ref_end) {
|
||||
if (ref < ref_start || ref > ref_end) {
|
||||
av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n");
|
||||
} else if (ref + 8*stride < dst || ref >= dst + 8*stride) {
|
||||
c->put_pixels_tab(dst, ref, stride, 8);
|
||||
@@ -973,7 +973,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
||||
xoff = binkb_get_value(c, BINKB_SRC_X_OFF);
|
||||
yoff = binkb_get_value(c, BINKB_SRC_Y_OFF) + ybias;
|
||||
ref = dst + xoff + yoff * stride;
|
||||
if (ref < ref_start || ref + 8 * stride > ref_end) {
|
||||
if (ref < ref_start || ref > ref_end) {
|
||||
av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n");
|
||||
} else if (ref + 8*stride < dst || ref >= dst + 8*stride) {
|
||||
c->put_pixels_tab(dst, ref, stride, 8);
|
||||
|
||||
@@ -139,9 +139,11 @@ static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s)
|
||||
// spx_noise_blend and spx_signal_blend are both FP.23
|
||||
nscale *= 1.0 / (1<<23);
|
||||
sscale *= 1.0 / (1<<23);
|
||||
if (nscale < -1.0)
|
||||
nscale = -1.0;
|
||||
#endif
|
||||
for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
|
||||
float noise = nscale * (int32_t)av_lfg_get(&s->dith_state);
|
||||
UINTFLOAT noise = (INTFLOAT)(nscale * (int32_t)av_lfg_get(&s->dith_state));
|
||||
s->transform_coeffs[ch][bin] *= sscale;
|
||||
s->transform_coeffs[ch][bin++] += noise;
|
||||
}
|
||||
|
||||
+11
-3
@@ -61,7 +61,7 @@ static av_cold int tgq_decode_init(AVCodecContext *avctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb)
|
||||
static int tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb)
|
||||
{
|
||||
uint8_t *perm = s->scantable.permutated;
|
||||
int i, j, value;
|
||||
@@ -69,6 +69,8 @@ static void tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb
|
||||
for (i = 1; i < 64;) {
|
||||
switch (show_bits(gb, 3)) {
|
||||
case 4:
|
||||
if (i >= 63)
|
||||
return AVERROR_INVALIDDATA;
|
||||
block[perm[i++]] = 0;
|
||||
case 0:
|
||||
block[perm[i++]] = 0;
|
||||
@@ -78,6 +80,8 @@ static void tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb
|
||||
case 1:
|
||||
skip_bits(gb, 2);
|
||||
value = get_bits(gb, 6);
|
||||
if (value > 64 - i)
|
||||
return AVERROR_INVALIDDATA;
|
||||
for (j = 0; j < value; j++)
|
||||
block[perm[i++]] = 0;
|
||||
break;
|
||||
@@ -105,6 +109,7 @@ static void tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb
|
||||
}
|
||||
}
|
||||
block[0] += 128 << 4;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void tgq_idct_put_mb(TgqContext *s, int16_t (*block)[64], AVFrame *frame,
|
||||
@@ -164,8 +169,11 @@ static int tgq_decode_mb(TgqContext *s, AVFrame *frame, int mb_y, int mb_x)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
tgq_decode_block(s, s->block[i], &gb);
|
||||
for (i = 0; i < 6; i++) {
|
||||
int ret = tgq_decode_block(s, s->block[i], &gb);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
tgq_idct_put_mb(s, s->block, frame, mb_x, mb_y);
|
||||
bytestream2_skip(&s->gb, mode);
|
||||
} else {
|
||||
|
||||
@@ -88,11 +88,6 @@ static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth,
|
||||
unsigned i, j;
|
||||
CodeBook cb = { 0 };
|
||||
|
||||
if (size >= INT_MAX / 34 || get_bits_left(gb) < size * 34)
|
||||
return cb;
|
||||
|
||||
if (size >= INT_MAX / sizeof(MacroBlock))
|
||||
return cb;
|
||||
cb.blocks = av_malloc(size ? size * sizeof(MacroBlock) : 1);
|
||||
if (!cb.blocks)
|
||||
return cb;
|
||||
@@ -226,7 +221,7 @@ static int escape124_decode_frame(AVCodecContext *avctx,
|
||||
// represent a lower bound of the space needed for skipped superblocks. Non
|
||||
// skipped SBs need more space.
|
||||
if (get_bits_left(&gb) < 64 + s->num_superblocks * 23LL / 4320)
|
||||
return -1;
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
frame_flags = get_bits_long(&gb, 32);
|
||||
frame_size = get_bits_long(&gb, 32);
|
||||
@@ -277,9 +272,14 @@ static int escape124_decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
av_freep(&s->codebooks[i].blocks);
|
||||
if (cb_size >= INT_MAX / 34 || get_bits_left(&gb) < (int)cb_size * 34)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (cb_size >= INT_MAX / sizeof(MacroBlock))
|
||||
return AVERROR_INVALIDDATA;
|
||||
s->codebooks[i] = unpack_codebook(&gb, cb_depth, cb_size);
|
||||
if (!s->codebooks[i].blocks)
|
||||
return -1;
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+45
-26
@@ -166,24 +166,31 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
|
||||
RangeCoder *c = &fs->c;
|
||||
uint8_t state[CONTEXT_SIZE];
|
||||
unsigned ps, i, context_count;
|
||||
int sx, sy, sw, sh;
|
||||
|
||||
memset(state, 128, sizeof(state));
|
||||
sx = get_symbol(c, state, 0);
|
||||
sy = get_symbol(c, state, 0);
|
||||
sw = get_symbol(c, state, 0) + 1U;
|
||||
sh = get_symbol(c, state, 0) + 1U;
|
||||
|
||||
av_assert0(f->version > 2);
|
||||
|
||||
fs->slice_x = get_symbol(c, state, 0) * f->width ;
|
||||
fs->slice_y = get_symbol(c, state, 0) * f->height;
|
||||
fs->slice_width = (get_symbol(c, state, 0) + 1) * f->width + fs->slice_x;
|
||||
fs->slice_height = (get_symbol(c, state, 0) + 1) * f->height + fs->slice_y;
|
||||
|
||||
fs->slice_x /= f->num_h_slices;
|
||||
fs->slice_y /= f->num_v_slices;
|
||||
fs->slice_width = fs->slice_width /f->num_h_slices - fs->slice_x;
|
||||
fs->slice_height = fs->slice_height/f->num_v_slices - fs->slice_y;
|
||||
if ((unsigned)fs->slice_width > f->width || (unsigned)fs->slice_height > f->height)
|
||||
return -1;
|
||||
if ( (unsigned)fs->slice_x + (uint64_t)fs->slice_width > f->width
|
||||
|| (unsigned)fs->slice_y + (uint64_t)fs->slice_height > f->height)
|
||||
return -1;
|
||||
if (sx < 0 || sy < 0 || sw <= 0 || sh <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (sx > f->num_h_slices - sw || sy > f->num_v_slices - sh)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
fs->slice_x = sx * (int64_t)f->width / f->num_h_slices;
|
||||
fs->slice_y = sy * (int64_t)f->height / f->num_v_slices;
|
||||
fs->slice_width = (sx + sw) * (int64_t)f->width / f->num_h_slices - fs->slice_x;
|
||||
fs->slice_height = (sy + sh) * (int64_t)f->height / f->num_v_slices - fs->slice_y;
|
||||
|
||||
av_assert0((unsigned)fs->slice_width <= f->width &&
|
||||
(unsigned)fs->slice_height <= f->height);
|
||||
av_assert0 ( (unsigned)fs->slice_x + (uint64_t)fs->slice_width <= f->width
|
||||
&& (unsigned)fs->slice_y + (uint64_t)fs->slice_height <= f->height);
|
||||
|
||||
if (fs->ac == AC_GOLOMB_RICE && fs->slice_width >= (1<<23))
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -301,8 +308,11 @@ static int decode_slice(AVCodecContext *c, void *arg)
|
||||
}
|
||||
if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0)
|
||||
return ret;
|
||||
if (f->cur->key_frame || fs->slice_reset_contexts)
|
||||
if (f->cur->key_frame || fs->slice_reset_contexts) {
|
||||
ff_ffv1_clear_slice_state(f, fs);
|
||||
} else if (fs->slice_damaged) {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
width = fs->slice_width;
|
||||
height = fs->slice_height;
|
||||
@@ -465,6 +475,11 @@ static int read_extra_header(FFV1Context *f)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (f->num_h_slices > MAX_SLICES / f->num_v_slices) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "slice count unsupported\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
f->quant_table_count = get_symbol(c, state, 0);
|
||||
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);
|
||||
@@ -767,21 +782,25 @@ static int read_header(FFV1Context *f)
|
||||
fs->slice_damaged = 0;
|
||||
|
||||
if (f->version == 2) {
|
||||
fs->slice_x = get_symbol(c, state, 0) * f->width ;
|
||||
fs->slice_y = get_symbol(c, state, 0) * f->height;
|
||||
fs->slice_width = (get_symbol(c, state, 0) + 1) * f->width + fs->slice_x;
|
||||
fs->slice_height = (get_symbol(c, state, 0) + 1) * f->height + fs->slice_y;
|
||||
int sx = get_symbol(c, state, 0);
|
||||
int sy = get_symbol(c, state, 0);
|
||||
int sw = get_symbol(c, state, 0) + 1U;
|
||||
int sh = get_symbol(c, state, 0) + 1U;
|
||||
|
||||
fs->slice_x /= f->num_h_slices;
|
||||
fs->slice_y /= f->num_v_slices;
|
||||
fs->slice_width = fs->slice_width / f->num_h_slices - fs->slice_x;
|
||||
fs->slice_height = fs->slice_height / f->num_v_slices - fs->slice_y;
|
||||
if ((unsigned)fs->slice_width > f->width ||
|
||||
(unsigned)fs->slice_height > f->height)
|
||||
if (sx < 0 || sy < 0 || sw <= 0 || sh <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if ( (unsigned)fs->slice_x + (uint64_t)fs->slice_width > f->width
|
||||
|| (unsigned)fs->slice_y + (uint64_t)fs->slice_height > f->height)
|
||||
if (sx > f->num_h_slices - sw || sy > f->num_v_slices - sh)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
fs->slice_x = sx * (int64_t)f->width / f->num_h_slices;
|
||||
fs->slice_y = sy * (int64_t)f->height / f->num_v_slices;
|
||||
fs->slice_width = (sx + sw) * (int64_t)f->width / f->num_h_slices - fs->slice_x;
|
||||
fs->slice_height = (sy + sh) * (int64_t)f->height / f->num_v_slices - fs->slice_y;
|
||||
|
||||
av_assert0((unsigned)fs->slice_width <= f->width &&
|
||||
(unsigned)fs->slice_height <= f->height);
|
||||
av_assert0 ( (unsigned)fs->slice_x + (uint64_t)fs->slice_width <= f->width
|
||||
&& (unsigned)fs->slice_y + (uint64_t)fs->slice_height <= f->height);
|
||||
}
|
||||
|
||||
for (i = 0; i < f->plane_count; i++) {
|
||||
|
||||
@@ -247,7 +247,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
|
||||
default: av_assert0(0);
|
||||
}
|
||||
|
||||
put_bits(pb, 16, 17);
|
||||
put_bits(pb, 16, 8 + 3 * components);
|
||||
if (lossless && ( avctx->pix_fmt == AV_PIX_FMT_BGR0
|
||||
|| avctx->pix_fmt == AV_PIX_FMT_BGRA
|
||||
|| avctx->pix_fmt == AV_PIX_FMT_BGR24))
|
||||
|
||||
+1
-1
@@ -521,7 +521,7 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
|
||||
|
||||
/* This should happen for TrueHD streams with >6 channels and MLP's noise
|
||||
* type. It is not yet known if this is allowed. */
|
||||
if (max_channel > MAX_MATRIX_CHANNEL_MLP && !noise_type) {
|
||||
if (max_matrix_channel > MAX_MATRIX_CHANNEL_MLP && !noise_type) {
|
||||
avpriv_request_sample(m->avctx,
|
||||
"%d channels (more than the "
|
||||
"maximum supported by the decoder)",
|
||||
|
||||
@@ -184,7 +184,7 @@ static YuvPixel mp_get_yuv_from_rgb(MotionPixelsContext *mp, int x, int y)
|
||||
int color;
|
||||
|
||||
color = *(uint16_t *)&mp->frame->data[0][y * mp->frame->linesize[0] + x * 2];
|
||||
return mp_rgb_yuv_table[color];
|
||||
return mp_rgb_yuv_table[color & 0x7FFF];
|
||||
}
|
||||
|
||||
static void mp_set_rgb_from_yuv(MotionPixelsContext *mp, int x, int y, const YuvPixel *p)
|
||||
|
||||
@@ -2999,6 +2999,10 @@ static int ipu_decode_frame(AVCodecContext *avctx, void *data,
|
||||
AVFrame * const frame = data;
|
||||
int ret;
|
||||
|
||||
// Check for minimal intra MB size (considering mb header, luma & chroma dc VLC, ac EOB VLC)
|
||||
if (avpkt->size*8LL < (avctx->width+15)/16 * ((avctx->height+15)/16) * (2 + 3*4 + 2*2 + 2*6))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
ret = ff_get_buffer(avctx, frame, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
+3
-2
@@ -1025,8 +1025,9 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx)
|
||||
|
||||
av_log(avctx, AV_LOG_VERBOSE, "CQ(%d) mode enabled.\n", tmp_quality);
|
||||
|
||||
//CQ mode shall discard avg bitrate & honor max bitrate;
|
||||
// CQ mode shall discard avg bitrate/vbv buffer size and honor only max bitrate
|
||||
ctx->encode_config.rcParams.averageBitRate = avctx->bit_rate = 0;
|
||||
ctx->encode_config.rcParams.vbvBufferSize = avctx->rc_buffer_size = 0;
|
||||
ctx->encode_config.rcParams.maxBitRate = avctx->rc_max_rate;
|
||||
}
|
||||
}
|
||||
@@ -1925,7 +1926,7 @@ static int nvenc_set_timestamp(AVCodecContext *avctx,
|
||||
pkt->pts = params->outputTimeStamp;
|
||||
pkt->dts = timestamp_queue_dequeue(ctx->timestamp_list);
|
||||
|
||||
pkt->dts -= FFMAX(ctx->encode_config.frameIntervalP - 1, 0) * FFMAX(avctx->ticks_per_frame, 1);
|
||||
pkt->dts -= FFMAX(ctx->encode_config.frameIntervalP - 1, 0) * FFMAX(avctx->ticks_per_frame, 1) * FFMAX(avctx->time_base.num, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -245,8 +245,6 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
run = bytestream2_get_le16(&s->g);
|
||||
val = bytestream2_get_byte(&s->g);
|
||||
}
|
||||
if (!bytestream2_get_bytes_left(&s->g))
|
||||
break;
|
||||
|
||||
if (bits_per_plane == 8) {
|
||||
picmemset_8bpp(s, frame, val, run, &x, &y);
|
||||
|
||||
+1
-1
@@ -322,7 +322,7 @@ void ff_png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
|
||||
static void deloco_ ## NAME(TYPE *dst, int size, int alpha) \
|
||||
{ \
|
||||
int i; \
|
||||
for (i = 0; i < size; i += 3 + alpha) { \
|
||||
for (i = 0; i < size - 2; i += 3 + alpha) { \
|
||||
int g = dst [i + 1]; \
|
||||
dst[i + 0] += g; \
|
||||
dst[i + 2] += g; \
|
||||
|
||||
+15
-7
@@ -204,7 +204,7 @@ static void get_max_component_diff(BlockInfo *bi, uint16_t *block_ptr,
|
||||
|
||||
// loop thru and compare pixels
|
||||
for (y = 0; y < bi->block_height; y++) {
|
||||
for (x = 0; x < bi->block_width; x++){
|
||||
for (x = 0; x < bi->block_width; x++) {
|
||||
// TODO: optimize
|
||||
min_r = FFMIN(R(block_ptr[x]), min_r);
|
||||
min_g = FFMIN(G(block_ptr[x]), min_g);
|
||||
@@ -276,7 +276,7 @@ static int leastsquares(uint16_t *block_ptr, BlockInfo *bi,
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < bi->block_height; i++) {
|
||||
for (j = 0; j < bi->block_width; j++){
|
||||
for (j = 0; j < bi->block_width; j++) {
|
||||
x = GET_CHAN(block_ptr[j], xchannel);
|
||||
y = GET_CHAN(block_ptr[j], ychannel);
|
||||
sumx += x;
|
||||
@@ -323,7 +323,7 @@ static int calc_lsq_max_fit_error(uint16_t *block_ptr, BlockInfo *bi,
|
||||
int max_err = 0;
|
||||
|
||||
for (i = 0; i < bi->block_height; i++) {
|
||||
for (j = 0; j < bi->block_width; j++){
|
||||
for (j = 0; j < bi->block_width; j++) {
|
||||
int x_inc, lin_y, lin_x;
|
||||
x = GET_CHAN(block_ptr[j], xchannel);
|
||||
y = GET_CHAN(block_ptr[j], ychannel);
|
||||
@@ -418,7 +418,9 @@ static void update_block_in_prev_frame(const uint16_t *src_pixels,
|
||||
uint16_t *dest_pixels,
|
||||
const BlockInfo *bi, int block_counter)
|
||||
{
|
||||
for (int y = 0; y < 4; y++) {
|
||||
const int y_size = FFMIN(4, bi->image_height - bi->row * 4);
|
||||
|
||||
for (int y = 0; y < y_size; y++) {
|
||||
memcpy(dest_pixels, src_pixels, 8);
|
||||
dest_pixels += bi->rowstride;
|
||||
src_pixels += bi->rowstride;
|
||||
@@ -728,14 +730,15 @@ post_skip :
|
||||
|
||||
if (err > s->sixteen_color_thresh) { // DO SIXTEEN COLOR BLOCK
|
||||
uint16_t *row_ptr;
|
||||
int rgb555;
|
||||
int y_size, rgb555;
|
||||
|
||||
block_offset = get_block_info(&bi, block_counter);
|
||||
|
||||
row_ptr = &src_pixels[block_offset];
|
||||
y_size = FFMIN(4, bi.image_height - bi.row * 4);
|
||||
|
||||
for (int y = 0; y < 4; y++) {
|
||||
for (int x = 0; x < 4; x++){
|
||||
for (int y = 0; y < y_size; y++) {
|
||||
for (int x = 0; x < 4; x++) {
|
||||
rgb555 = row_ptr[x] & ~0x8000;
|
||||
|
||||
put_bits(&s->pb, 16, rgb555);
|
||||
@@ -743,6 +746,11 @@ post_skip :
|
||||
row_ptr += bi.rowstride;
|
||||
}
|
||||
|
||||
for (int y = y_size; y < 4; y++) {
|
||||
for (int x = 0; x < 4; x++)
|
||||
put_bits(&s->pb, 16, 0);
|
||||
}
|
||||
|
||||
block_counter++;
|
||||
} else { // FOUR COLOR BLOCK
|
||||
block_counter += encode_four_color_block(min_color, max_color,
|
||||
|
||||
@@ -459,6 +459,9 @@ static int decompress_p(AVCodecContext *avctx,
|
||||
int run, bx = x * 16 + sx1, by = y * 16 + sy1;
|
||||
uint32_t r, g, b, clr, ptype = 0;
|
||||
|
||||
if (bx >= avctx->width)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
for (; by < y * 16 + sy2 && by < avctx->height;) {
|
||||
ret = decode_value(s, s->op_model[ptype], 6, 1000, &ptype);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -1168,6 +1168,9 @@ static int decompress_p3(AVCodecContext *avctx,
|
||||
int run, bx = x * 16 + sx1, by = y * 16 + sy1;
|
||||
uint32_t clr, ptype = 0, r, g, b;
|
||||
|
||||
if (bx >= avctx->width)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
for (; by < y * 16 + sy2 && by < avctx->height;) {
|
||||
ret = decode_value3(s, 5, &s->op_model3[ptype].cntsum,
|
||||
s->op_model3[ptype].freqs[0],
|
||||
|
||||
@@ -1544,10 +1544,10 @@ static void calculate_visual_weight(SnowContext *s, Plane *p){
|
||||
int level, orientation, x, y;
|
||||
|
||||
for(level=0; level<s->spatial_decomposition_count; level++){
|
||||
int64_t error=0;
|
||||
for(orientation=level ? 1 : 0; orientation<4; orientation++){
|
||||
SubBand *b= &p->band[level][orientation];
|
||||
IDWTELEM *ibuf= b->ibuf;
|
||||
int64_t error=0;
|
||||
|
||||
memset(s->spatial_idwt_buffer, 0, sizeof(*s->spatial_idwt_buffer)*width*height);
|
||||
ibuf[b->width/2 + b->height/2*b->stride]= 256*16;
|
||||
@@ -1558,9 +1558,13 @@ static void calculate_visual_weight(SnowContext *s, Plane *p){
|
||||
error += d*d;
|
||||
}
|
||||
}
|
||||
|
||||
if (orientation == 2)
|
||||
error /= 2;
|
||||
b->qlog= (int)(QROOT * log2(352256.0/sqrt(error)) + 0.5);
|
||||
if (orientation != 1)
|
||||
error = 0;
|
||||
}
|
||||
p->band[level][1].qlog = p->band[level][2].qlog;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -500,6 +500,8 @@ static int speedhq_decode_frame(AVCodecContext *avctx,
|
||||
|
||||
if (buf_size < 4 || avctx->width < 8 || avctx->width % 8 != 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (buf_size < avctx->width*avctx->height / 64 / 4)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
quality = buf[0];
|
||||
if (quality >= 100) {
|
||||
|
||||
+17
-2
@@ -19,6 +19,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
@@ -75,6 +76,12 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
if (maplength > 768) {
|
||||
av_log(avctx, AV_LOG_WARNING, "invalid colormap length\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
// This also checks depth to be valid
|
||||
switch (depth) {
|
||||
case 1:
|
||||
avctx->pix_fmt = maplength ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_MONOWHITE;
|
||||
@@ -96,15 +103,23 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
// This checks w and h to be valid in the sense that bytes of a padded bitmap are addressable with 32bit int
|
||||
ret = ff_set_dimensions(avctx, w, h);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
// ensured by ff_set_dimensions()
|
||||
av_assert0(w <= (INT32_MAX - 7) / depth);
|
||||
|
||||
/* scanlines are aligned on 16 bit boundaries */
|
||||
len = (depth * w + 7) >> 3;
|
||||
alen = len + (len & 1);
|
||||
|
||||
if (buf_end - buf < maplength + (len * h) * 3 / 256)
|
||||
// ensured by ff_set_dimensions()
|
||||
av_assert0(h <= INT32_MAX / (3 * len));
|
||||
|
||||
// maplength is limited to 768 and the right term is limited to INT32_MAX / 256 so the add needs no check
|
||||
if (buf_end - buf < (uint64_t)maplength + (len * h) * 3 / 256)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||
@@ -118,7 +133,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
|
||||
} else if (maplength) {
|
||||
unsigned int len = maplength / 3;
|
||||
|
||||
if (maplength % 3 || maplength > 768) {
|
||||
if (maplength % 3) {
|
||||
av_log(avctx, AV_LOG_WARNING, "invalid colormap length\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
+24
-12
@@ -31,11 +31,13 @@ int main(void){
|
||||
#define width 256
|
||||
#define height 256
|
||||
int buffer[2][width*height];
|
||||
short obuffer[width*height];
|
||||
SnowContext s;
|
||||
int i;
|
||||
AVLFG prng;
|
||||
s.spatial_decomposition_count=6;
|
||||
s.spatial_decomposition_type=1;
|
||||
int ret = 0;
|
||||
|
||||
s.temp_dwt_buffer = av_mallocz_array(width, sizeof(DWTELEM));
|
||||
s.temp_idwt_buffer = av_mallocz_array(width, sizeof(IDWTELEM));
|
||||
@@ -49,24 +51,34 @@ int main(void){
|
||||
|
||||
printf("testing 5/3 DWT\n");
|
||||
for(i=0; i<width*height; i++)
|
||||
buffer[0][i] = buffer[1][i] = av_lfg_get(&prng) % 54321 - 12345;
|
||||
buffer[0][i] = buffer[1][i] = av_lfg_get(&prng) % 19000 - 9000;
|
||||
|
||||
ff_spatial_dwt(buffer[0], s.temp_dwt_buffer, width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
|
||||
ff_spatial_idwt((IDWTELEM*)buffer[0], s.temp_idwt_buffer, width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
|
||||
for(i=0; i<width*height; i++)
|
||||
obuffer[i] = buffer[0][i];
|
||||
ff_spatial_idwt(obuffer, s.temp_idwt_buffer, width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
|
||||
|
||||
for(i=0; i<width*height; i++)
|
||||
if(buffer[0][i]!= buffer[1][i]) printf("fsck: %6d %12d %7d\n",i, buffer[0][i], buffer[1][i]);
|
||||
if(buffer[1][i]!= obuffer[i]) {
|
||||
printf("fsck: %4dx%4dx %12d %7d\n",i%width, i/width, buffer[1][i], obuffer[i]);
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
printf("testing 9/7 DWT\n");
|
||||
s.spatial_decomposition_type=0;
|
||||
for(i=0; i<width*height; i++)
|
||||
buffer[0][i] = buffer[1][i] = av_lfg_get(&prng) % 54321 - 12345;
|
||||
buffer[0][i] = buffer[1][i] = av_lfg_get(&prng) % 11000 - 5000;
|
||||
|
||||
ff_spatial_dwt(buffer[0], s.temp_dwt_buffer, width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
|
||||
ff_spatial_idwt((IDWTELEM*)buffer[0], s.temp_idwt_buffer, width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
|
||||
for(i=0; i<width*height; i++)
|
||||
obuffer[i] = buffer[0][i];
|
||||
ff_spatial_idwt(obuffer, s.temp_idwt_buffer, width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
|
||||
|
||||
for(i=0; i<width*height; i++)
|
||||
if(FFABS(buffer[0][i] - buffer[1][i])>20) printf("fsck: %6d %12d %7d\n",i, buffer[0][i], buffer[1][i]);
|
||||
if(FFABS(buffer[1][i] - obuffer[i])>20) {
|
||||
printf("fsck: %4dx%4d %12d %7d\n",i%width, i/width, buffer[1][i], obuffer[i]);
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
{
|
||||
int level, orientation, x, y;
|
||||
@@ -81,18 +93,18 @@ int main(void){
|
||||
int w= width >> (s.spatial_decomposition_count-level);
|
||||
int h= height >> (s.spatial_decomposition_count-level);
|
||||
int stride= width << (s.spatial_decomposition_count-level);
|
||||
DWTELEM *buf= buffer[0];
|
||||
IDWTELEM *buf= obuffer;
|
||||
int64_t error=0;
|
||||
|
||||
if(orientation&1) buf+=w;
|
||||
if(orientation>1) buf+=stride>>1;
|
||||
|
||||
memset(buffer[0], 0, sizeof(int)*width*height);
|
||||
buf[w/2 + h/2*stride]= 256*256;
|
||||
ff_spatial_idwt((IDWTELEM*)buffer[0], s.temp_idwt_buffer, width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
|
||||
memset(obuffer, 0, sizeof(short)*width*height);
|
||||
buf[w/2 + h/2*stride]= 8*256;
|
||||
ff_spatial_idwt(obuffer, s.temp_idwt_buffer, width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
|
||||
for(y=0; y<height; y++){
|
||||
for(x=0; x<width; x++){
|
||||
int64_t d= buffer[0][x + y*width];
|
||||
int64_t d= obuffer[x + y*width];
|
||||
error += d*d;
|
||||
if(FFABS(width/2-x)<9 && FFABS(height/2-y)<9 && level==2) printf("%8"PRId64" ", d);
|
||||
}
|
||||
@@ -143,5 +155,5 @@ int main(void){
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
+2
-4
@@ -100,7 +100,6 @@ typedef struct TiffContext {
|
||||
int is_tiled;
|
||||
int tile_byte_counts_offset, tile_offsets_offset;
|
||||
int tile_width, tile_length;
|
||||
int tile_count;
|
||||
|
||||
int is_jpeg;
|
||||
|
||||
@@ -988,7 +987,7 @@ static int dng_decode_tiles(AVCodecContext *avctx, AVFrame *frame,
|
||||
tile_count_y = (s->height + s->tile_length - 1) / s->tile_length;
|
||||
|
||||
/* Iterate over the number of tiles */
|
||||
for (tile_idx = 0; tile_idx < s->tile_count; tile_idx++) {
|
||||
for (tile_idx = 0; tile_idx < tile_count_x * tile_count_y; tile_idx++) {
|
||||
tile_x = tile_idx % tile_count_x;
|
||||
tile_y = tile_idx / tile_count_x;
|
||||
|
||||
@@ -1408,7 +1407,6 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
|
||||
break;
|
||||
case TIFF_TILE_OFFSETS:
|
||||
s->tile_offsets_offset = off;
|
||||
s->tile_count = count;
|
||||
s->is_tiled = 1;
|
||||
break;
|
||||
case TIFF_TILE_BYTE_COUNTS:
|
||||
@@ -1903,7 +1901,7 @@ again:
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
has_tile_bits = s->is_tiled || s->tile_byte_counts_offset || s->tile_offsets_offset || s->tile_width || s->tile_length || s->tile_count;
|
||||
has_tile_bits = s->is_tiled || s->tile_byte_counts_offset || s->tile_offsets_offset || s->tile_width || s->tile_length;
|
||||
has_strip_bits = s->strippos || s->strips || s->stripoff || s->rps || s->sot || s->sstype || s->stripsize || s->stripsizesoff;
|
||||
|
||||
if (has_tile_bits && has_strip_bits) {
|
||||
|
||||
@@ -236,6 +236,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
||||
case AV_PIX_FMT_GBRAP16BE:
|
||||
w_align = 16; //FIXME assume 16 pixel per macroblock
|
||||
h_align = 16 * 2; // interlaced needs 2 macroblocks height
|
||||
if (s->codec_id == AV_CODEC_ID_BINKVIDEO)
|
||||
w_align = 16*2;
|
||||
break;
|
||||
case AV_PIX_FMT_YUV411P:
|
||||
case AV_PIX_FMT_YUVJ411P:
|
||||
@@ -314,6 +316,7 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
||||
*width = FFALIGN(*width, w_align);
|
||||
*height = FFALIGN(*height, h_align);
|
||||
if (s->codec_id == AV_CODEC_ID_H264 || s->lowres ||
|
||||
s->codec_id == AV_CODEC_ID_VC1 || s->codec_id == AV_CODEC_ID_WMV3 ||
|
||||
s->codec_id == AV_CODEC_ID_VP5 || s->codec_id == AV_CODEC_ID_VP6 ||
|
||||
s->codec_id == AV_CODEC_ID_VP6F || s->codec_id == AV_CODEC_ID_VP6A
|
||||
) {
|
||||
@@ -327,6 +330,9 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
||||
// the next rounded up width is 32
|
||||
*width = FFMAX(*width, 32);
|
||||
}
|
||||
if (s->codec_id == AV_CODEC_ID_SVQ3) {
|
||||
*width = FFMAX(*width, 32);
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
linesize_align[i] = STRIDE_ALIGN;
|
||||
|
||||
@@ -60,7 +60,7 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
|
||||
av_assert2(start_x < end_x && block_w);
|
||||
|
||||
w = end_x - start_x;
|
||||
src += start_y * src_linesize + start_x * sizeof(pixel);
|
||||
src += start_y * src_linesize + start_x * (ptrdiff_t)sizeof(pixel);
|
||||
buf += start_x * sizeof(pixel);
|
||||
|
||||
// top
|
||||
@@ -83,7 +83,7 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
|
||||
buf += buf_linesize;
|
||||
}
|
||||
|
||||
buf -= block_h * buf_linesize + start_x * sizeof(pixel);
|
||||
buf -= block_h * buf_linesize + start_x * (ptrdiff_t)sizeof(pixel);
|
||||
while (block_h--) {
|
||||
pixel *bufp = (pixel *) buf;
|
||||
|
||||
|
||||
+6
-1
@@ -2683,8 +2683,13 @@ static int vp3_decode_frame(AVCodecContext *avctx,
|
||||
if ((ret = ff_thread_get_buffer(avctx, &s->current_frame, AV_GET_BUFFER_FLAG_REF)) < 0)
|
||||
goto error;
|
||||
|
||||
if (!s->edge_emu_buffer)
|
||||
if (!s->edge_emu_buffer) {
|
||||
s->edge_emu_buffer = av_malloc(9 * FFABS(s->current_frame.f->linesize[0]));
|
||||
if (!s->edge_emu_buffer) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (s->keyframe) {
|
||||
if (!s->theora) {
|
||||
|
||||
@@ -128,7 +128,7 @@ static av_always_inline unsigned get_tail(GetBitContext *gb, int k)
|
||||
e = (1 << (p + 1)) - k - 1;
|
||||
res = get_bitsz(gb, p);
|
||||
if (res >= e)
|
||||
res = (res << 1) - e + get_bits1(gb);
|
||||
res = res * 2U - e + get_bits1(gb);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -498,6 +498,8 @@ static int wv_unpack_dsd_high(WavpackFrameContext *s, uint8_t *dst_left, uint8_t
|
||||
sp[0].fltr0 = 0;
|
||||
}
|
||||
|
||||
if (DSD_BYTE_READY(high, low) && !bytestream2_get_bytes_left(&s->gbyte))
|
||||
return AVERROR_INVALIDDATA;
|
||||
while (DSD_BYTE_READY(high, low) && bytestream2_get_bytes_left(&s->gbyte)) {
|
||||
value = (value << 8) | bytestream2_get_byte(&s->gbyte);
|
||||
high = (high << 8) | 0xff;
|
||||
@@ -533,6 +535,8 @@ static int wv_unpack_dsd_high(WavpackFrameContext *s, uint8_t *dst_left, uint8_t
|
||||
sp[1].fltr0 = 0;
|
||||
}
|
||||
|
||||
if (DSD_BYTE_READY(high, low) && !bytestream2_get_bytes_left(&s->gbyte))
|
||||
return AVERROR_INVALIDDATA;
|
||||
while (DSD_BYTE_READY(high, low) && bytestream2_get_bytes_left(&s->gbyte)) {
|
||||
value = (value << 8) | bytestream2_get_byte(&s->gbyte);
|
||||
high = (high << 8) | 0xff;
|
||||
|
||||
@@ -355,6 +355,9 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (size > SIZE_MAX / 4)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
size *= 4;
|
||||
|
||||
ptr += mod_strcspn(ptr, ",") + 1;
|
||||
|
||||
@@ -139,8 +139,8 @@ static int activate(AVFilterContext *ctx)
|
||||
if (!(s->desc->flags & AV_PIX_FMT_FLAG_PAL || s->desc->flags & FF_PSEUDOPAL)) {
|
||||
for (i = 1; i < 3; i ++) {
|
||||
if (out->data[i]) {
|
||||
out->data[i] += (y >> s->desc->log2_chroma_w) * out->linesize[i];
|
||||
out->data[i] += (x >> s->desc->log2_chroma_h) * s->max_step[i];
|
||||
out->data[i] += (y >> s->desc->log2_chroma_h) * out->linesize[i];
|
||||
out->data[i] += (x >> s->desc->log2_chroma_w) * s->max_step[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -376,10 +376,10 @@ static void read_uslt(AVFormatContext *s, AVIOContext *pb, int taglen,
|
||||
lang[3] = '\0';
|
||||
taglen -= 3;
|
||||
|
||||
if (decode_str(s, pb, encoding, &descriptor, &taglen) < 0)
|
||||
if (decode_str(s, pb, encoding, &descriptor, &taglen) < 0 || taglen < 0)
|
||||
goto error;
|
||||
|
||||
if (decode_str(s, pb, encoding, &text, &taglen) < 0)
|
||||
if (decode_str(s, pb, encoding, &text, &taglen) < 0 || taglen < 0)
|
||||
goto error;
|
||||
|
||||
// FFmpeg does not support hierarchical metadata, so concatenate the keys.
|
||||
|
||||
@@ -3963,6 +3963,13 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
||||
if (keyframe)
|
||||
distance = 0;
|
||||
sample_size = sc->stsz_sample_size > 0 ? sc->stsz_sample_size : sc->sample_sizes[current_sample];
|
||||
if (current_offset > INT64_MAX - sample_size) {
|
||||
av_log(mov->fc, AV_LOG_ERROR, "Current offset %"PRId64" or sample size %u is too large\n",
|
||||
current_offset,
|
||||
sample_size);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sc->pseudo_stream_id == -1 ||
|
||||
sc->stsc_data[stsc_index].id - 1 == sc->pseudo_stream_id) {
|
||||
AVIndexEntry *e;
|
||||
|
||||
@@ -3516,8 +3516,8 @@ static int64_t mxf_compute_sample_count(MXFContext *mxf, AVStream *st,
|
||||
if ((sample_rate.num / sample_rate.den) == 48000) {
|
||||
return av_rescale_q(edit_unit, sample_rate, track->edit_rate);
|
||||
} else {
|
||||
int remainder = (sample_rate.num * time_base.num) %
|
||||
(time_base.den * sample_rate.den);
|
||||
int64_t remainder = (sample_rate.num * (int64_t) time_base.num) %
|
||||
( time_base.den * (int64_t)sample_rate.den);
|
||||
if (remainder)
|
||||
av_log(mxf->fc, AV_LOG_WARNING,
|
||||
"seeking detected on stream #%d with time base (%d/%d) and "
|
||||
|
||||
+12
-4
@@ -358,8 +358,12 @@ static int decode_main_header(NUTContext *nut)
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
for (i = 0; i < stream_count; i++)
|
||||
avformat_new_stream(s, NULL);
|
||||
for (i = 0; i < stream_count; i++) {
|
||||
if (!avformat_new_stream(s, NULL)) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
@@ -807,19 +811,23 @@ static int nut_read_header(AVFormatContext *s)
|
||||
NUTContext *nut = s->priv_data;
|
||||
AVIOContext *bc = s->pb;
|
||||
int64_t pos;
|
||||
int initialized_stream_count;
|
||||
int initialized_stream_count, ret;
|
||||
|
||||
nut->avf = s;
|
||||
|
||||
/* main header */
|
||||
pos = 0;
|
||||
ret = 0;
|
||||
do {
|
||||
if (ret == AVERROR(ENOMEM))
|
||||
return ret;
|
||||
|
||||
pos = find_startcode(bc, MAIN_STARTCODE, pos) + 1;
|
||||
if (pos < 0 + 1) {
|
||||
av_log(s, AV_LOG_ERROR, "No main startcode found.\n");
|
||||
goto fail;
|
||||
}
|
||||
} while (decode_main_header(nut) < 0);
|
||||
} while ((ret = decode_main_header(nut)) < 0);
|
||||
|
||||
/* stream headers */
|
||||
pos = 0;
|
||||
|
||||
@@ -61,7 +61,7 @@ static int32_t parse_value(const char *value, int32_t min)
|
||||
}
|
||||
}
|
||||
|
||||
if (abs(db) > (INT32_MAX - mb) / 100000)
|
||||
if (llabs(db) > (INT32_MAX - mb) / 100000)
|
||||
return min;
|
||||
|
||||
return db * 100000 + sign * mb;
|
||||
|
||||
@@ -118,8 +118,8 @@
|
||||
.endm
|
||||
|
||||
.macro increment_yuv422p
|
||||
add x6, x6, w7, UXTW // srcU += incU
|
||||
add x13, x13, w14, UXTW // srcV += incV
|
||||
add x6, x6, w7, SXTW // srcU += incU
|
||||
add x13, x13, w14, SXTW // srcV += incV
|
||||
.endm
|
||||
|
||||
.macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
|
||||
@@ -189,8 +189,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
|
||||
st4 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
|
||||
subs w8, w8, #16 // width -= 16
|
||||
b.gt 2b
|
||||
add x2, x2, w3, UXTW // dst += padding
|
||||
add x4, x4, w5, UXTW // srcY += paddingY
|
||||
add x2, x2, w3, SXTW // dst += padding
|
||||
add x4, x4, w5, SXTW // srcY += paddingY
|
||||
increment_\ifmt
|
||||
subs w1, w1, #1 // height -= 1
|
||||
b.gt 1b
|
||||
|
||||
+12
-12
@@ -84,9 +84,9 @@ rgb64ToUV_half_c_template(uint16_t *dstU, uint16_t *dstV,
|
||||
int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
|
||||
av_assert1(src1==src2);
|
||||
for (i = 0; i < width; i++) {
|
||||
int r_b = (input_pixel(&src1[8 * i + 0]) + input_pixel(&src1[8 * i + 4]) + 1) >> 1;
|
||||
int g = (input_pixel(&src1[8 * i + 1]) + input_pixel(&src1[8 * i + 5]) + 1) >> 1;
|
||||
int b_r = (input_pixel(&src1[8 * i + 2]) + input_pixel(&src1[8 * i + 6]) + 1) >> 1;
|
||||
unsigned r_b = (input_pixel(&src1[8 * i + 0]) + input_pixel(&src1[8 * i + 4]) + 1) >> 1;
|
||||
unsigned g = (input_pixel(&src1[8 * i + 1]) + input_pixel(&src1[8 * i + 5]) + 1) >> 1;
|
||||
unsigned b_r = (input_pixel(&src1[8 * i + 2]) + input_pixel(&src1[8 * i + 6]) + 1) >> 1;
|
||||
|
||||
dstU[i]= (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
|
||||
dstV[i]= (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT;
|
||||
@@ -156,9 +156,9 @@ static av_always_inline void rgb48ToUV_c_template(uint16_t *dstU,
|
||||
int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
|
||||
av_assert1(src1 == src2);
|
||||
for (i = 0; i < width; i++) {
|
||||
int r_b = input_pixel(&src1[i * 3 + 0]);
|
||||
int g = input_pixel(&src1[i * 3 + 1]);
|
||||
int b_r = input_pixel(&src1[i * 3 + 2]);
|
||||
unsigned r_b = input_pixel(&src1[i * 3 + 0]);
|
||||
unsigned g = input_pixel(&src1[i * 3 + 1]);
|
||||
unsigned b_r = input_pixel(&src1[i * 3 + 2]);
|
||||
|
||||
dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
|
||||
dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
|
||||
@@ -178,12 +178,12 @@ static av_always_inline void rgb48ToUV_half_c_template(uint16_t *dstU,
|
||||
int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
|
||||
av_assert1(src1 == src2);
|
||||
for (i = 0; i < width; i++) {
|
||||
int r_b = (input_pixel(&src1[6 * i + 0]) +
|
||||
input_pixel(&src1[6 * i + 3]) + 1) >> 1;
|
||||
int g = (input_pixel(&src1[6 * i + 1]) +
|
||||
input_pixel(&src1[6 * i + 4]) + 1) >> 1;
|
||||
int b_r = (input_pixel(&src1[6 * i + 2]) +
|
||||
input_pixel(&src1[6 * i + 5]) + 1) >> 1;
|
||||
unsigned r_b = (input_pixel(&src1[6 * i + 0]) +
|
||||
input_pixel(&src1[6 * i + 3]) + 1) >> 1;
|
||||
unsigned g = (input_pixel(&src1[6 * i + 1]) +
|
||||
input_pixel(&src1[6 * i + 4]) + 1) >> 1;
|
||||
unsigned b_r = (input_pixel(&src1[6 * i + 2]) +
|
||||
input_pixel(&src1[6 * i + 5]) + 1) >> 1;
|
||||
|
||||
dstU[i] = (ru*r + gu*g + bu*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
|
||||
dstV[i] = (rv*r + gv*g + bv*b + (0x10001 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT;
|
||||
|
||||
+60
-60
@@ -1043,8 +1043,8 @@ yuv2rgba64_X_c_template(SwsContext *c, const int16_t *lumFilter,
|
||||
Y2 -= c->yuv2rgb_y_offset;
|
||||
Y1 *= c->yuv2rgb_y_coeff;
|
||||
Y2 *= c->yuv2rgb_y_coeff;
|
||||
Y1 += 1 << 13; // 21
|
||||
Y2 += 1 << 13;
|
||||
Y1 += (1 << 13) - (1 << 29); // 21
|
||||
Y2 += (1 << 13) - (1 << 29);
|
||||
// 8 bits: 17 + 13 bits = 30 bits, 16 bits: 17 + 13 bits = 30 bits
|
||||
|
||||
R = V * c->yuv2rgb_v2r_coeff;
|
||||
@@ -1052,20 +1052,20 @@ yuv2rgba64_X_c_template(SwsContext *c, const int16_t *lumFilter,
|
||||
B = U * c->yuv2rgb_u2b_coeff;
|
||||
|
||||
// 8 bits: 30 - 22 = 8 bits, 16 bits: 30 bits - 14 = 16 bits
|
||||
output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
|
||||
output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
|
||||
output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
|
||||
output_pixel(&dest[0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[1], av_clip_uintp2((( G + Y1) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 16));
|
||||
if (eightbytes) {
|
||||
output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14);
|
||||
output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
|
||||
output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[5], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[6], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14);
|
||||
dest += 8;
|
||||
} else {
|
||||
output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14);
|
||||
output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);
|
||||
output_pixel(&dest[3], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[4], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[5], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16));
|
||||
dest += 6;
|
||||
}
|
||||
}
|
||||
@@ -1102,8 +1102,8 @@ yuv2rgba64_2_c_template(SwsContext *c, const int32_t *buf[2],
|
||||
Y2 -= c->yuv2rgb_y_offset;
|
||||
Y1 *= c->yuv2rgb_y_coeff;
|
||||
Y2 *= c->yuv2rgb_y_coeff;
|
||||
Y1 += 1 << 13;
|
||||
Y2 += 1 << 13;
|
||||
Y1 += (1 << 13) - (1 << 29);
|
||||
Y2 += (1 << 13) - (1 << 29);
|
||||
|
||||
R = V * c->yuv2rgb_v2r_coeff;
|
||||
G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
|
||||
@@ -1117,20 +1117,20 @@ yuv2rgba64_2_c_template(SwsContext *c, const int32_t *buf[2],
|
||||
A2 += 1 << 13;
|
||||
}
|
||||
|
||||
output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
|
||||
output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
|
||||
output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
|
||||
output_pixel(&dest[0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[1], av_clip_uintp2((( G + Y1) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 16));
|
||||
if (eightbytes) {
|
||||
output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14);
|
||||
output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
|
||||
output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[5], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[6], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14);
|
||||
dest += 8;
|
||||
} else {
|
||||
output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14);
|
||||
output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);
|
||||
output_pixel(&dest[3], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[4], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[5], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16));
|
||||
dest += 6;
|
||||
}
|
||||
}
|
||||
@@ -1158,8 +1158,8 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0,
|
||||
Y2 -= c->yuv2rgb_y_offset;
|
||||
Y1 *= c->yuv2rgb_y_coeff;
|
||||
Y2 *= c->yuv2rgb_y_coeff;
|
||||
Y1 += 1 << 13;
|
||||
Y2 += 1 << 13;
|
||||
Y1 += (1 << 13) - (1 << 29);
|
||||
Y2 += (1 << 13) - (1 << 29);
|
||||
|
||||
if (hasAlpha) {
|
||||
A1 = abuf0[i * 2 ] << 11;
|
||||
@@ -1173,20 +1173,20 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0,
|
||||
G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
|
||||
B = U * c->yuv2rgb_u2b_coeff;
|
||||
|
||||
output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
|
||||
output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
|
||||
output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
|
||||
output_pixel(&dest[0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[1], av_clip_uintp2((( G + Y1) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 16));
|
||||
if (eightbytes) {
|
||||
output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14);
|
||||
output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
|
||||
output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[5], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[6], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14);
|
||||
dest += 8;
|
||||
} else {
|
||||
output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14);
|
||||
output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);
|
||||
output_pixel(&dest[3], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[4], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[5], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16));
|
||||
dest += 6;
|
||||
}
|
||||
}
|
||||
@@ -1204,8 +1204,8 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0,
|
||||
Y2 -= c->yuv2rgb_y_offset;
|
||||
Y1 *= c->yuv2rgb_y_coeff;
|
||||
Y2 *= c->yuv2rgb_y_coeff;
|
||||
Y1 += 1 << 13;
|
||||
Y2 += 1 << 13;
|
||||
Y1 += (1 << 13) - (1 << 29);
|
||||
Y2 += (1 << 13) - (1 << 29);
|
||||
|
||||
if (hasAlpha) {
|
||||
A1 = abuf0[i * 2 ] << 11;
|
||||
@@ -1219,20 +1219,20 @@ yuv2rgba64_1_c_template(SwsContext *c, const int32_t *buf0,
|
||||
G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
|
||||
B = U * c->yuv2rgb_u2b_coeff;
|
||||
|
||||
output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);
|
||||
output_pixel(&dest[1], av_clip_uintp2( G + Y1, 30) >> 14);
|
||||
output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);
|
||||
output_pixel(&dest[0], av_clip_uintp2(((R_B + Y1) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[1], av_clip_uintp2((( G + Y1) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[2], av_clip_uintp2(((B_R + Y1) >> 14) + (1<<15), 16));
|
||||
if (eightbytes) {
|
||||
output_pixel(&dest[3], av_clip_uintp2(A1 , 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14);
|
||||
output_pixel(&dest[5], av_clip_uintp2( G + Y2, 30) >> 14);
|
||||
output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[5], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[6], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[7], av_clip_uintp2(A2 , 30) >> 14);
|
||||
dest += 8;
|
||||
} else {
|
||||
output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);
|
||||
output_pixel(&dest[4], av_clip_uintp2( G + Y2, 30) >> 14);
|
||||
output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);
|
||||
output_pixel(&dest[3], av_clip_uintp2(((R_B + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[4], av_clip_uintp2((( G + Y2) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[5], av_clip_uintp2(((B_R + Y2) >> 14) + (1<<15), 16));
|
||||
dest += 6;
|
||||
}
|
||||
}
|
||||
@@ -1283,7 +1283,7 @@ yuv2rgba64_full_X_c_template(SwsContext *c, const int16_t *lumFilter,
|
||||
// 8bit: 27 -> 17bit, 16bit: 31 - 14 = 17bit
|
||||
Y -= c->yuv2rgb_y_offset;
|
||||
Y *= c->yuv2rgb_y_coeff;
|
||||
Y += 1 << 13; // 21
|
||||
Y += (1 << 13) - (1<<29); // 21
|
||||
// 8bit: 17 + 13bit = 30bit, 16bit: 17 + 13bit = 30bit
|
||||
|
||||
R = V * c->yuv2rgb_v2r_coeff;
|
||||
@@ -1291,9 +1291,9 @@ yuv2rgba64_full_X_c_template(SwsContext *c, const int16_t *lumFilter,
|
||||
B = U * c->yuv2rgb_u2b_coeff;
|
||||
|
||||
// 8bit: 30 - 22 = 8bit, 16bit: 30bit - 14 = 16bit
|
||||
output_pixel(&dest[0], av_clip_uintp2(R_B + Y, 30) >> 14);
|
||||
output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14);
|
||||
output_pixel(&dest[2], av_clip_uintp2(B_R + Y, 30) >> 14);
|
||||
output_pixel(&dest[0], av_clip_uintp2(((R_B + Y)>>14) + (1<<15), 16));
|
||||
output_pixel(&dest[1], av_clip_uintp2((( G + Y)>>14) + (1<<15), 16));
|
||||
output_pixel(&dest[2], av_clip_uintp2(((B_R + Y)>>14) + (1<<15), 16));
|
||||
if (eightbytes) {
|
||||
output_pixel(&dest[3], av_clip_uintp2(A, 30) >> 14);
|
||||
dest += 4;
|
||||
@@ -1331,7 +1331,7 @@ yuv2rgba64_full_2_c_template(SwsContext *c, const int32_t *buf[2],
|
||||
|
||||
Y -= c->yuv2rgb_y_offset;
|
||||
Y *= c->yuv2rgb_y_coeff;
|
||||
Y += 1 << 13;
|
||||
Y += (1 << 13) - (1 << 29);
|
||||
|
||||
R = V * c->yuv2rgb_v2r_coeff;
|
||||
G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
|
||||
@@ -1343,9 +1343,9 @@ yuv2rgba64_full_2_c_template(SwsContext *c, const int32_t *buf[2],
|
||||
A += 1 << 13;
|
||||
}
|
||||
|
||||
output_pixel(&dest[0], av_clip_uintp2(R_B + Y, 30) >> 14);
|
||||
output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14);
|
||||
output_pixel(&dest[2], av_clip_uintp2(B_R + Y, 30) >> 14);
|
||||
output_pixel(&dest[0], av_clip_uintp2(((R_B + Y) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[1], av_clip_uintp2((( G + Y) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[2], av_clip_uintp2(((B_R + Y) >> 14) + (1<<15), 16));
|
||||
if (eightbytes) {
|
||||
output_pixel(&dest[3], av_clip_uintp2(A, 30) >> 14);
|
||||
dest += 4;
|
||||
@@ -1374,7 +1374,7 @@ yuv2rgba64_full_1_c_template(SwsContext *c, const int32_t *buf0,
|
||||
|
||||
Y -= c->yuv2rgb_y_offset;
|
||||
Y *= c->yuv2rgb_y_coeff;
|
||||
Y += 1 << 13;
|
||||
Y += (1 << 13) - (1 << 29);
|
||||
|
||||
if (hasAlpha) {
|
||||
A = abuf0[i] << 11;
|
||||
@@ -1386,9 +1386,9 @@ yuv2rgba64_full_1_c_template(SwsContext *c, const int32_t *buf0,
|
||||
G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
|
||||
B = U * c->yuv2rgb_u2b_coeff;
|
||||
|
||||
output_pixel(&dest[0], av_clip_uintp2(R_B + Y, 30) >> 14);
|
||||
output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14);
|
||||
output_pixel(&dest[2], av_clip_uintp2(B_R + Y, 30) >> 14);
|
||||
output_pixel(&dest[0], av_clip_uintp2(((R_B + Y) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[1], av_clip_uintp2((( G + Y) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[2], av_clip_uintp2(((B_R + Y) >> 14) + (1<<15), 16));
|
||||
if (eightbytes) {
|
||||
output_pixel(&dest[3], av_clip_uintp2(A, 30) >> 14);
|
||||
dest += 4;
|
||||
@@ -1407,7 +1407,7 @@ yuv2rgba64_full_1_c_template(SwsContext *c, const int32_t *buf0,
|
||||
|
||||
Y -= c->yuv2rgb_y_offset;
|
||||
Y *= c->yuv2rgb_y_coeff;
|
||||
Y += 1 << 13;
|
||||
Y += (1 << 13) - (1 << 29);
|
||||
|
||||
if (hasAlpha) {
|
||||
A = abuf0[i] << 11;
|
||||
@@ -1419,9 +1419,9 @@ yuv2rgba64_full_1_c_template(SwsContext *c, const int32_t *buf0,
|
||||
G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
|
||||
B = U * c->yuv2rgb_u2b_coeff;
|
||||
|
||||
output_pixel(&dest[0], av_clip_uintp2(R_B + Y, 30) >> 14);
|
||||
output_pixel(&dest[1], av_clip_uintp2( G + Y, 30) >> 14);
|
||||
output_pixel(&dest[2], av_clip_uintp2(B_R + Y, 30) >> 14);
|
||||
output_pixel(&dest[0], av_clip_uintp2(((R_B + Y) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[1], av_clip_uintp2((( G + Y) >> 14) + (1<<15), 16));
|
||||
output_pixel(&dest[2], av_clip_uintp2(((B_R + Y) >> 14) + (1<<15), 16));
|
||||
if (eightbytes) {
|
||||
output_pixel(&dest[3], av_clip_uintp2(A, 30) >> 14);
|
||||
dest += 4;
|
||||
|
||||
@@ -2,45 +2,45 @@ ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 3035
|
||||
ret: 0 st:-1 flags:0 ts:-1.000000
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 3035
|
||||
ret: 0 st:-1 flags:1 ts: 1.894167
|
||||
ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39806 size: 3640
|
||||
ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39690 size: 3640
|
||||
ret: 0 st: 0 flags:0 ts: 0.800000
|
||||
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27442 size: 3494
|
||||
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27382 size: 3493
|
||||
ret:-1 st: 0 flags:1 ts:-0.320000
|
||||
ret:-1 st:-1 flags:0 ts: 2.576668
|
||||
ret: 0 st:-1 flags:1 ts: 1.470835
|
||||
ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39806 size: 3640
|
||||
ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39690 size: 3640
|
||||
ret: 0 st: 0 flags:0 ts: 0.360000
|
||||
ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16134 size: 3244
|
||||
ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16074 size: 3245
|
||||
ret:-1 st: 0 flags:1 ts:-0.760000
|
||||
ret:-1 st:-1 flags:0 ts: 2.153336
|
||||
ret: 0 st:-1 flags:1 ts: 1.047503
|
||||
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27442 size: 3494
|
||||
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27382 size: 3493
|
||||
ret: 0 st: 0 flags:0 ts:-0.040000
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 3035
|
||||
ret: 0 st: 0 flags:1 ts: 2.840000
|
||||
ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52608 size: 3582
|
||||
ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52538 size: 3582
|
||||
ret: 0 st:-1 flags:0 ts: 1.730004
|
||||
ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52608 size: 3582
|
||||
ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52538 size: 3582
|
||||
ret: 0 st:-1 flags:1 ts: 0.624171
|
||||
ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16134 size: 3244
|
||||
ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16074 size: 3245
|
||||
ret: 0 st: 0 flags:0 ts:-0.480000
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 3035
|
||||
ret: 0 st: 0 flags:1 ts: 2.400000
|
||||
ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52608 size: 3582
|
||||
ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52538 size: 3582
|
||||
ret: 0 st:-1 flags:0 ts: 1.306672
|
||||
ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39806 size: 3640
|
||||
ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39690 size: 3640
|
||||
ret: 0 st:-1 flags:1 ts: 0.200839
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 3035
|
||||
ret: 0 st: 0 flags:0 ts:-0.920000
|
||||
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 5652 size: 3035
|
||||
ret: 0 st: 0 flags:1 ts: 2.000000
|
||||
ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52608 size: 3582
|
||||
ret: 0 st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos: 52538 size: 3582
|
||||
ret: 0 st:-1 flags:0 ts: 0.883340
|
||||
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27442 size: 3494
|
||||
ret: 0 st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos: 27382 size: 3493
|
||||
ret:-1 st:-1 flags:1 ts:-0.222493
|
||||
ret:-1 st: 0 flags:0 ts: 2.680000
|
||||
ret: 0 st: 0 flags:1 ts: 1.560000
|
||||
ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39806 size: 3640
|
||||
ret: 0 st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos: 39690 size: 3640
|
||||
ret: 0 st:-1 flags:0 ts: 0.460008
|
||||
ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16134 size: 3244
|
||||
ret: 0 st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 16074 size: 3245
|
||||
ret:-1 st:-1 flags:1 ts:-0.645825
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
67c10f8d52fcd1103caa675a1408bf6e *tests/data/fate/vsynth1-snow.avi
|
||||
136088 tests/data/fate/vsynth1-snow.avi
|
||||
bfc0bcc4bc7b956933aa58acc587018d *tests/data/fate/vsynth1-snow.out.rawvideo
|
||||
stddev: 22.77 PSNR: 20.98 MAXDIFF: 175 bytes: 7603200/ 7603200
|
||||
c4c77a6fb926b89fe6591c398f5cd4db *tests/data/fate/vsynth1-snow.avi
|
||||
136160 tests/data/fate/vsynth1-snow.avi
|
||||
dcf8b3f62d9c3ae2b2d0fbbacbf83e4e *tests/data/fate/vsynth1-snow.out.rawvideo
|
||||
stddev: 22.74 PSNR: 20.99 MAXDIFF: 173 bytes: 7603200/ 7603200
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
e62ae25d5040d04622a965bcb27fdb1e *tests/data/fate/vsynth1-snow-hpel.avi
|
||||
138446 tests/data/fate/vsynth1-snow-hpel.avi
|
||||
57c914cd150f8fc260b5989ce3e5884c *tests/data/fate/vsynth1-snow-hpel.out.rawvideo
|
||||
stddev: 22.74 PSNR: 20.99 MAXDIFF: 172 bytes: 7603200/ 7603200
|
||||
5c9eb93646eb0e5570d37e9adc9625e4 *tests/data/fate/vsynth1-snow-hpel.avi
|
||||
138580 tests/data/fate/vsynth1-snow-hpel.avi
|
||||
3382bdde624d8bb4af206a5ac6614605 *tests/data/fate/vsynth1-snow-hpel.out.rawvideo
|
||||
stddev: 22.71 PSNR: 21.00 MAXDIFF: 171 bytes: 7603200/ 7603200
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
0a41e73ddd2f54936490655b46dad4a3 *tests/data/fate/vsynth2-snow.avi
|
||||
72868 tests/data/fate/vsynth2-snow.avi
|
||||
34a75f5cf8a71159f1a572d9cedcfef9 *tests/data/fate/vsynth2-snow.out.rawvideo
|
||||
stddev: 13.73 PSNR: 25.37 MAXDIFF: 162 bytes: 7603200/ 7603200
|
||||
5e130d6a48b69348eee7f7c76c5869a3 *tests/data/fate/vsynth2-snow.avi
|
||||
72942 tests/data/fate/vsynth2-snow.avi
|
||||
9b6cee60e3ec0d1f312a8a25a7878fcc *tests/data/fate/vsynth2-snow.out.rawvideo
|
||||
stddev: 13.39 PSNR: 25.59 MAXDIFF: 154 bytes: 7603200/ 7603200
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
9bc409e4794ee50691a26c9c836d31a7 *tests/data/fate/vsynth2-snow-hpel.avi
|
||||
79728 tests/data/fate/vsynth2-snow-hpel.avi
|
||||
2cc64d8171175a1532fd7d3ed3011fbf *tests/data/fate/vsynth2-snow-hpel.out.rawvideo
|
||||
stddev: 13.70 PSNR: 25.39 MAXDIFF: 162 bytes: 7603200/ 7603200
|
||||
8edcf0fd7f066972ff77d5b891ed6dde *tests/data/fate/vsynth2-snow-hpel.avi
|
||||
79798 tests/data/fate/vsynth2-snow-hpel.avi
|
||||
7e0f2a24feda6fb3e54b85511a28c45f *tests/data/fate/vsynth2-snow-hpel.out.rawvideo
|
||||
stddev: 13.35 PSNR: 25.62 MAXDIFF: 157 bytes: 7603200/ 7603200
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
8e96f337e8f4ccac7d72ef517e1d2208 *tests/data/fate/vsynth_lena-snow.avi
|
||||
57680 tests/data/fate/vsynth_lena-snow.avi
|
||||
90963cfd2359d460001c94d94256dc2b *tests/data/fate/vsynth_lena-snow.out.rawvideo
|
||||
stddev: 10.48 PSNR: 27.72 MAXDIFF: 119 bytes: 7603200/ 7603200
|
||||
bf2cf9cacc1d98388798be98872049ee *tests/data/fate/vsynth_lena-snow.avi
|
||||
57604 tests/data/fate/vsynth_lena-snow.avi
|
||||
707a42eb20195913be55ba8dfadf72fb *tests/data/fate/vsynth_lena-snow.out.rawvideo
|
||||
stddev: 10.37 PSNR: 27.81 MAXDIFF: 120 bytes: 7603200/ 7603200
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
56b14cb1cbb637536233982e87f7ac3e *tests/data/fate/vsynth_lena-snow-hpel.avi
|
||||
61764 tests/data/fate/vsynth_lena-snow-hpel.avi
|
||||
244b0266127fa354d8485234b2c388e4 *tests/data/fate/vsynth_lena-snow-hpel.out.rawvideo
|
||||
stddev: 10.45 PSNR: 27.74 MAXDIFF: 119 bytes: 7603200/ 7603200
|
||||
c6ec87a11415a99b1a781f9f5bacb722 *tests/data/fate/vsynth_lena-snow-hpel.avi
|
||||
61814 tests/data/fate/vsynth_lena-snow-hpel.avi
|
||||
40f330397b7acf6bdbb3ec6d908be451 *tests/data/fate/vsynth_lena-snow-hpel.out.rawvideo
|
||||
stddev: 10.34 PSNR: 27.83 MAXDIFF: 118 bytes: 7603200/ 7603200
|
||||
|
||||
Reference in New Issue
Block a user