diff options
author | Nils Wallménius <nils@rockbox.org> | 2010-12-08 16:44:08 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2010-12-08 16:44:08 +0000 |
commit | 7484fd3b18c7cf0f48f171cca40c29ec762c8310 (patch) | |
tree | c8de2ac507c7deb24e1d97cdc2258b3bd4a6998f | |
parent | 199b2a84e2b29bd7da582ab1588ebcb6f158928c (diff) | |
download | rockbox-7484fd3b18c7cf0f48f171cca40c29ec762c8310.tar.gz rockbox-7484fd3b18c7cf0f48f171cca40c29ec762c8310.zip |
libtremor: merge upstream revision 17538 'Fix decoder handling of floor0 when the LSP order is 1.'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28770 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/libtremor/asm_arm.h | 10 | ||||
-rw-r--r-- | apps/codecs/libtremor/floor0.c | 23 |
2 files changed, 19 insertions, 14 deletions
diff --git a/apps/codecs/libtremor/asm_arm.h b/apps/codecs/libtremor/asm_arm.h index 6f38efcd4b..9531f21657 100644 --- a/apps/codecs/libtremor/asm_arm.h +++ b/apps/codecs/libtremor/asm_arm.h | |||
@@ -249,8 +249,9 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip, | |||
249 | ogg_int32_t qexp=*qexpp; | 249 | ogg_int32_t qexp=*qexpp; |
250 | 250 | ||
251 | asm("mov r0,%3;" | 251 | asm("mov r0,%3;" |
252 | "mov r1,%5,asr#1;" | 252 | "movs r1,%5,asr#1;" |
253 | "add r0,r0,r1,lsl#3;" | 253 | "add r0,r0,r1,lsl#3;" |
254 | "beq 2f;\n" | ||
254 | "1:" | 255 | "1:" |
255 | 256 | ||
256 | "ldmdb r0!,{r1,r3};" | 257 | "ldmdb r0!,{r1,r3};" |
@@ -273,9 +274,10 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip, | |||
273 | "cmp r0,%3;\n" | 274 | "cmp r0,%3;\n" |
274 | "bhi 1b;\n" | 275 | "bhi 1b;\n" |
275 | 276 | ||
277 | "2:" | ||
276 | // odd filter assymetry | 278 | // odd filter assymetry |
277 | "ands r0,%5,#1;\n" | 279 | "ands r0,%5,#1;\n" |
278 | "beq 2f;\n" | 280 | "beq 3f;\n" |
279 | "add r0,%3,%5,lsl#2;\n" | 281 | "add r0,%3,%5,lsl#2;\n" |
280 | 282 | ||
281 | "ldr r1,[r0,#-4];\n" | 283 | "ldr r1,[r0,#-4];\n" |
@@ -287,7 +289,7 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip, | |||
287 | "umull %1,r3,r0,%1;\n" //pi*=labs(ilsp[j+1]-wi) | 289 | "umull %1,r3,r0,%1;\n" //pi*=labs(ilsp[j+1]-wi) |
288 | 290 | ||
289 | "cmn r2,r3;\n" // shift down 16? | 291 | "cmn r2,r3;\n" // shift down 16? |
290 | "beq 2f;\n" | 292 | "beq 3f;\n" |
291 | "add %2,%2,#16;\n" | 293 | "add %2,%2,#16;\n" |
292 | "mov %0,%0,lsr #16;\n" | 294 | "mov %0,%0,lsr #16;\n" |
293 | "orr %0,%0,r2,lsl #16;\n" | 295 | "orr %0,%0,r2,lsl #16;\n" |
@@ -301,7 +303,7 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip, | |||
301 | //} | 303 | //} |
302 | 304 | ||
303 | /* normalize to max 16 sig figs */ | 305 | /* normalize to max 16 sig figs */ |
304 | "2:" | 306 | "3:" |
305 | "mov r2,#0;" | 307 | "mov r2,#0;" |
306 | "orr r1,%0,%1;" | 308 | "orr r1,%0,%1;" |
307 | "tst r1,#0xff000000;" | 309 | "tst r1,#0xff000000;" |
diff --git a/apps/codecs/libtremor/floor0.c b/apps/codecs/libtremor/floor0.c index 5062450748..075bc36ef7 100644 --- a/apps/codecs/libtremor/floor0.c +++ b/apps/codecs/libtremor/floor0.c | |||
@@ -200,16 +200,19 @@ static void vorbis_lsp_to_curve(ogg_int32_t *curve,int *map,int n,int ln, | |||
200 | 200 | ||
201 | #else | 201 | #else |
202 | 202 | ||
203 | qi*=labs(ilsp[0]-wi); | 203 | j=1; |
204 | pi*=labs(ilsp[1]-wi); | 204 | if(m>1){ |
205 | 205 | qi*=labs(ilsp[0]-wi); | |
206 | for(j=3;j<m;j+=2){ | 206 | pi*=labs(ilsp[1]-wi); |
207 | if(!(shift=MLOOP_1[(pi|qi)>>25])) | 207 | |
208 | if(!(shift=MLOOP_2[(pi|qi)>>19])) | 208 | for(j+=2;j<m;j+=2){ |
209 | shift=MLOOP_3[(pi|qi)>>16]; | 209 | if(!(shift=MLOOP_1[(pi|qi)>>25])) |
210 | qi=(qi>>shift)*labs(ilsp[j-1]-wi); | 210 | if(!(shift=MLOOP_2[(pi|qi)>>19])) |
211 | pi=(pi>>shift)*labs(ilsp[j]-wi); | 211 | shift=MLOOP_3[(pi|qi)>>16]; |
212 | qexp+=shift; | 212 | qi=(qi>>shift)*labs(ilsp[j-1]-wi); |
213 | pi=(pi>>shift)*labs(ilsp[j]-wi); | ||
214 | qexp+=shift; | ||
215 | } | ||
213 | } | 216 | } |
214 | if(!(shift=MLOOP_1[(pi|qi)>>25])) | 217 | if(!(shift=MLOOP_1[(pi|qi)>>25])) |
215 | if(!(shift=MLOOP_2[(pi|qi)>>19])) | 218 | if(!(shift=MLOOP_2[(pi|qi)>>19])) |