summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-05 20:10:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-05 20:22:09 +0200
commit517dcc9b5fc4294669c0b6edaaa3ff166d412219 (patch)
treeafff025f131c22971259fd339a1663191fbb3a20 /libavcodec
parent5f4e18cd162be2375cdd623816de58207b0b8a31 (diff)
parentf0ccd53a3b0bbe704a7bc94dbc8caac7be81e079 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: tests: Refactor rotozoom/videogen common code into a separate file. tests: Mark some file-internal symbols as static. build: Drop leftover .exp pattern from LIBSUFFIXES list. vsrc_buffer: return EAGAIN if no frame is available. WMAL: Shift output samples by the specified number of padding zeroes. WMAL: Restore removed code in mclms_predict() rtpdec_h264: Remove a useless ifdef rtpdec_h264: Remove outdated/useless/incorrect comments rtpdec_h264: Remove useless memory corruption checks rtpdec_h264: Return proper error codes rtpdec_h264: Check the available data length before reading rtpdec_h264: Add input size checks png: check bit depth for PAL8/Y400A pixel formats. ea: check chunk_size for validity. celp filters: Do not read earlier than the start of the 'out' vector. Conflicts: libavcodec/pngdec.c libavfilter/src_buffer.c tests/rotozoom.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/celp_filters.c4
-rw-r--r--libavcodec/pngdec.c2
-rw-r--r--libavcodec/wmalosslessdec.c6
3 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/celp_filters.c b/libavcodec/celp_filters.c
index 1535060c9d..04ede491ac 100644
--- a/libavcodec/celp_filters.c
+++ b/libavcodec/celp_filters.c
@@ -133,9 +133,8 @@ void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs,
out2 -= val * old_out2;
out3 -= val * old_out3;
- old_out3 = out[-5];
-
for (i = 5; i <= filter_length; i += 2) {
+ old_out3 = out[-i];
val = filter_coeffs[i-1];
out0 -= val * old_out3;
@@ -154,7 +153,6 @@ void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs,
FFSWAP(float, old_out0, old_out2);
old_out1 = old_out3;
- old_out3 = out[-i-2];
}
tmp0 = out0;
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 5d0604eea9..e55a3823c0 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -501,7 +501,7 @@ static int decode_frame(AVCodecContext *avctx,
avctx->pix_fmt = PIX_FMT_MONOBLACK;
} else if (s->bit_depth == 8 &&
s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
- avctx->pix_fmt = PIX_FMT_GRAY8A;
+ avctx->pix_fmt = PIX_FMT_Y400A;
} else {
av_log(avctx, AV_LOG_ERROR, "unsupported bit depth %d "
"and color type %d\n",
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 879bfb6d0e..0b386ceedc 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -658,9 +658,9 @@ static void mclms_predict(WmallDecodeCtx *s, int icoef, int *pred)
int num_channels = s->num_channels;
for (ich = 0; ich < num_channels; ich++) {
+ pred[ich] = 0;
if (!s->is_channel_coded[ich])
continue;
- pred[ich] = 0;
for (i = 0; i < order * num_channels; i++)
pred[ich] += s->mclms_prevvalues[i + s->mclms_recent] *
s->mclms_coeffs[i + order * num_channels * ich];
@@ -983,10 +983,10 @@ static int decode_subframe(WmallDecodeCtx *s)
for (j = 0; j < subframe_len; j++) {
if (s->bits_per_sample == 16) {
- *s->samples_16[c] = (int16_t) s->channel_residues[c][j];
+ *s->samples_16[c] = (int16_t) s->channel_residues[c][j] << padding_zeroes;
s->samples_16[c] += s->num_channels;
} else {
- *s->samples_32[c] = s->channel_residues[c][j];
+ *s->samples_32[c] = s->channel_residues[c][j] << padding_zeroes;
s->samples_32[c] += s->num_channels;
}
}