Commit c3f5b811 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote branch 'qatar/master'

* qatar/master:
  ALPHA: Replace sized int_fast integer types with plain int/unsigned.
Duplicate  DPX image encoder
Duplicate  DPX decoder: read sample aspect ratio
Duplciate  DPX decoder: add buffer size checks.
  ac3enc: clip large coefficient values and negative exponents rather than using av_assert2().
  ac3enc: do not store a bandwidth code for each channel.
  ac3enc: remove bandwidth reduction as fallback for bit allocation failure.
  ac3enc: merge compute_exp_strategy_ch() into compute_exp_strategy()
  ac3enc: return error if frame+exponent bits are too large instead of using av_assert2().
  ac3enc: differentiate between current block and reference block in bit_alloc()
  ac3enc: simplify exponent_init() by calculating exponent_group_tab[] based on exponent group sizes.
  ac3enc: simplify stereo rematrixing decision options
Include both URLs:  Update URL to fate samples

Conflicts:
	Changelog
	doc/fate.txt
	libavcodec/ac3enc.c
	libavcodec/dpxenc.c
	libavcodec/version.h
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 3862ebba ad1862d6
......@@ -353,4 +353,16 @@ HDCD A/D Converter
@end table
@subheading Other AC-3 Encoding Options
@table @option
@item -stereo_rematrixing @var{boolean}
Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
is an optional AC-3 feature that increases quality by selectively encoding
the left/right channels as mid/side. This option is enabled by default, and it
is highly recommended that it be left as enabled except for testing purposes.
@end table
@c man end ENCODERS
......@@ -8,6 +8,7 @@ that is provided separately from the actual source distribution.
Use the following command to get the fate test samples
# rsync -aL rsync://rsync.mplayerhq.hu:/samples/fate-suite/ fate/fate-suite
# rsync -aL rsync://fate-suite.libav.org:/fate-suite/ fate-suite
To inform the build system about the testsuite location, pass
`--samples=<path to the samples>` to configure or set the SAMPLES Make
......
......@@ -158,6 +158,7 @@ typedef struct AC3EncOptions {
/* other encoding options */
int allow_per_frame_metadata;
int stereo_rematrixing;
} AC3EncOptions;
......
......@@ -164,8 +164,10 @@ static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs)
if (e >= 24) {
e = 24;
coef[i] = 0;
} else if (e < 0) {
e = 0;
coef[i] = av_clip(coef[i], -16777215, 16777215);
}
av_assert2(e >= 0);
}
exp[i] = e;
}
......
This diff is collapsed.
......@@ -46,7 +46,7 @@
/* 0: all entries 0, 1: only first entry nonzero, 2: otherwise */
static inline int idct_row(DCTELEM *row)
{
int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3, t;
int a0, a1, a2, a3, b0, b1, b2, b3, t;
uint64_t l, r, t2;
l = ldq(row);
r = ldq(row + 4);
......@@ -154,7 +154,7 @@ static inline int idct_row(DCTELEM *row)
static inline void idct_col(DCTELEM *col)
{
int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3;
int a0, a1, a2, a3, b0, b1, b2, b3;
col[0] += (1 << (COL_SHIFT - 1)) / W4;
......@@ -235,7 +235,7 @@ static inline void idct_col2(DCTELEM *col)
uint64_t l, r;
for (i = 0; i < 8; ++i) {
int_fast32_t a0 = col[i] + (1 << (COL_SHIFT - 1)) / W4;
int a0 = col[i] + (1 << (COL_SHIFT - 1)) / W4;
a0 *= W4;
col[i] = a0 >> COL_SHIFT;
......
......@@ -136,7 +136,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
switch(s->bits_per_component) {
case 8:
case 16:
size = avpicture_layout((AVPicture*)data, avctx->pix_fmt,
size = avpicture_layout(data, avctx->pix_fmt,
avctx->width, avctx->height,
buf + HEADER_SIZE, buf_size - HEADER_SIZE);
if (size < 0)
......@@ -146,7 +146,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
size = avctx->height * avctx->width * 4;
if (buf_size < HEADER_SIZE + size)
return -1;
encode_rgb48_10bit(avctx, (AVPicture*)data, buf + HEADER_SIZE);
encode_rgb48_10bit(avctx, data, buf + HEADER_SIZE);
break;
default:
av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n", s->bits_per_component);
......@@ -160,13 +160,13 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
}
AVCodec ff_dpx_encoder = {
"dpx",
AVMEDIA_TYPE_VIDEO,
CODEC_ID_DPX,
sizeof(DPXContext),
encode_init,
encode_frame,
.pix_fmts= (const enum PixelFormat[]){
.name = "dpx",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_DPX,
.priv_data_size = sizeof(DPXContext),
.init = encode_init,
.encode = encode_frame,
.pix_fmts = (const enum PixelFormat[]){
PIX_FMT_RGB24,
PIX_FMT_RGBA,
PIX_FMT_RGB48LE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment