summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor/floor1.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-12-08 17:28:17 +0000
committerNils Wallménius <nils@rockbox.org>2010-12-08 17:28:17 +0000
commit2aa511f6bdac6364fe09a0004e4e14b3fc17a6c2 (patch)
tree7c9bad037e3f57f7138d3846ccdccc48a752cd80 /apps/codecs/libtremor/floor1.c
parentaff90a9db734186e680c4ef747d66d32a83eb2aa (diff)
downloadrockbox-2aa511f6bdac6364fe09a0004e4e14b3fc17a6c2.tar.gz
rockbox-2aa511f6bdac6364fe09a0004e4e14b3fc17a6c2.zip
libtremor: merge upstream revisions 17541, 17542, 17543, 17544, 17545, 17546, 17547, 17555, 17572, bringing in various fixes and finally bringing our libtremor up to date, for now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28773 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libtremor/floor1.c')
-rw-r--r--apps/codecs/libtremor/floor1.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/codecs/libtremor/floor1.c b/apps/codecs/libtremor/floor1.c
index ae92b23058..65286399d0 100644
--- a/apps/codecs/libtremor/floor1.c
+++ b/apps/codecs/libtremor/floor1.c
@@ -361,7 +361,7 @@ static void *floor1_inverse1(vorbis_block *vb,vorbis_look_floor *in){
361 } 361 }
362 } 362 }
363 363
364 fit_value[i]=val+predicted; 364 fit_value[i]=(val+predicted)&0x7fff;;
365 fit_value[look->loneighbor[i-2]]&=0x7fff; 365 fit_value[look->loneighbor[i-2]]&=0x7fff;
366 fit_value[look->hineighbor[i-2]]&=0x7fff; 366 fit_value[look->hineighbor[i-2]]&=0x7fff;
367 367
@@ -393,14 +393,19 @@ static int floor1_inverse2(vorbis_block *vb,vorbis_look_floor *in,void *memo,
393 int hx=0; 393 int hx=0;
394 int lx=0; 394 int lx=0;
395 int ly=fit_value[0]*info->mult; 395 int ly=fit_value[0]*info->mult;
396 /* guard lookup against out-of-range values */
397 ly=(ly<0?0:ly>255?255:ly);
398
396 for(j=1;j<look->posts;j++){ 399 for(j=1;j<look->posts;j++){
397 int current=look->forward_index[j]; 400 int current=look->forward_index[j];
398 int hy=fit_value[current]&0x7fff; 401 int hy=fit_value[current]&0x7fff;
399 if(hy==fit_value[current]){ 402 if(hy==fit_value[current]){
400 403
404 hx=info->postlist[current];
401 hy*=info->mult; 405 hy*=info->mult;
402 hx=info->postlist[current]; 406 /* guard lookup against out-of-range values */
403 407 hy=(hy<0?0:hy>255?255:hy);
408
404 render_line(lx, ly, hx, hy, out); 409 render_line(lx, ly, hx, hy, out);
405 410
406 lx=hx; 411 lx=hx;