summaryrefslogtreecommitdiff
path: root/libavcodec/vorbis.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-03 02:41:47 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-03 03:51:32 +0100
commitd77294c5e404c8a214da0e74f7836390b48b2dba (patch)
tree9c894cf54b1e18f285cc04eaf7e021e9976f4f2b /libavcodec/vorbis.c
parent9477fa094b89645b3a34ef3bc52c4f18719ab4b3 (diff)
parente15e2a6d2a886aa9944ac9798687104c829d1541 (diff)
downloadffmpeg-d77294c5e404c8a214da0e74f7836390b48b2dba.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: libx264: fix indentation. vorbis: fix overflows in floor1[] vector and inverse db table index. win64: add a XMM clobber test configure option. movdec: Parse the dvc1 atom ARM: ac3: fix ac3_bit_alloc_calc_bap_armv6 swscale: K&R formatting cosmetics for Blackfin code frwu: lowercase the FRWU codec name movdec: fix dts generation in fragmented files fate: make acodec-ac3_fixed test output raw AC3 APIchanges: add missing commit hashes swscale: implement MMX, SSE2 and AVX functions for RGB32 input. ra144enc: drop pointless "encoder" from .long_name bethsoftvideo: fix palette reading. mpc7: use av_fast_padded_malloc() mpc7: simplify handling of packet sizes that are not a multiple of 4 bytes doc: decoding Forward Uncompressed is supported Fix a typo in the x86 asm version of ff_vector_clip_int32() pcmenc: Do not set avpkt->size. ff_alloc_packet: modify the size of the packet to match the requested size Conflicts: doc/APIchanges libavcodec/libx264.c libavcodec/mpc7.c libavformat/isom.h libswscale/Makefile libswscale/bfin/yuv2rgb_bfin.c tests/ref/fate/bethsoft-vid tests/ref/seek/ac3_ac3 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vorbis.c')
-rw-r--r--libavcodec/vorbis.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c
index 28176f3b12..fac8d0b2cd 100644
--- a/libavcodec/vorbis.c
+++ b/libavcodec/vorbis.c
@@ -156,7 +156,7 @@ void ff_vorbis_ready_floor1_list(vorbis_floor1_entry * list, int values)
}
}
-static inline void render_line_unrolled(intptr_t x, uint8_t y, int x1,
+static inline void render_line_unrolled(intptr_t x, int y, int x1,
intptr_t sy, int ady, int adx,
float *buf)
{
@@ -168,30 +168,30 @@ static inline void render_line_unrolled(intptr_t x, uint8_t y, int x1,
if (err >= 0) {
err += ady - adx;
y += sy;
- buf[x++] = ff_vorbis_floor1_inverse_db_table[y];
+ buf[x++] = ff_vorbis_floor1_inverse_db_table[av_clip_uint8(y)];
}
- buf[x] = ff_vorbis_floor1_inverse_db_table[y];
+ buf[x] = ff_vorbis_floor1_inverse_db_table[av_clip_uint8(y)];
}
if (x <= 0) {
if (err + ady >= 0)
y += sy;
- buf[x] = ff_vorbis_floor1_inverse_db_table[y];
+ buf[x] = ff_vorbis_floor1_inverse_db_table[av_clip_uint8(y)];
}
}
-static void render_line(int x0, uint8_t y0, int x1, int y1, float *buf)
+static void render_line(int x0, int y0, int x1, int y1, float *buf)
{
int dy = y1 - y0;
int adx = x1 - x0;
int ady = FFABS(dy);
int sy = dy < 0 ? -1 : 1;
- buf[x0] = ff_vorbis_floor1_inverse_db_table[y0];
+ buf[x0] = ff_vorbis_floor1_inverse_db_table[av_clip_uint8(y0)];
if (ady*2 <= adx) { // optimized common case
render_line_unrolled(x0, y0, x1, sy, ady, adx, buf);
} else {
int base = dy / adx;
int x = x0;
- uint8_t y = y0;
+ int y = y0;
int err = -adx;
ady -= FFABS(base) * adx;
while (++x < x1) {
@@ -201,7 +201,7 @@ static void render_line(int x0, uint8_t y0, int x1, int y1, float *buf)
err -= adx;
y += sy;
}
- buf[x] = ff_vorbis_floor1_inverse_db_table[y];
+ buf[x] = ff_vorbis_floor1_inverse_db_table[av_clip_uint8(y)];
}
}
}
@@ -210,8 +210,7 @@ void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
uint16_t *y_list, int *flag,
int multiplier, float *out, int samples)
{
- int lx, i;
- uint8_t ly;
+ int lx, ly, i;
lx = 0;
ly = y_list[0] * multiplier;
for (i = 1; i < values; i++) {