summaryrefslogtreecommitdiff
path: root/apps/codecs/demac/libdemac/predictor-arm.S
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/demac/libdemac/predictor-arm.S')
-rw-r--r--apps/codecs/demac/libdemac/predictor-arm.S27
1 files changed, 16 insertions, 11 deletions
diff --git a/apps/codecs/demac/libdemac/predictor-arm.S b/apps/codecs/demac/libdemac/predictor-arm.S
index dfeba0dcc8..d62b6186f8 100644
--- a/apps/codecs/demac/libdemac/predictor-arm.S
+++ b/apps/codecs/demac/libdemac/predictor-arm.S
@@ -468,14 +468,24 @@ loop:
468 468
469 add r11, r12, #historybuffer @ r11 := &p->historybuffer[0] 469 add r11, r12, #historybuffer @ r11 := &p->historybuffer[0]
470 470
471 sub r10, r14, #PREDICTOR_HISTORY_SIZE*4 471 sub r10, r14, #PREDICTOR_HISTORY_SIZE*4
472 @ r10 := p->buf - PREDICTOR_HISTORY_SIZE 472 @ r10 := p->buf - PREDICTOR_HISTORY_SIZE
473 473
474 cmp r10, r11 474 cmp r10, r11
475 bne endofloop 475 beq move_hist @ The history buffer is full, we need to do a memmove
476 476
477 @ The history buffer is full, we need to do a memmove: 477 @ Check loop count
478 ldr r0, [sp, #8]
479 subs r0, r0, #1
480 strne r0, [sp, #8]
481 bne loop
482
483done:
484 str r14, [r12] @ Save value of p->buf
485 add sp, sp, #12 @ Don't bother restoring r1-r3
486 ldmia sp!, {r4-r11, pc}
478 487
488move_hist:
479 @ dest = r11 (p->historybuffer) 489 @ dest = r11 (p->historybuffer)
480 @ src = r14 (p->buf) 490 @ src = r14 (p->buf)
481 @ n = 200 491 @ n = 200
@@ -493,15 +503,10 @@ loop:
493 503
494 add r14, r12, #historybuffer @ p->buf = &p->historybuffer[0] 504 add r14, r12, #historybuffer @ p->buf = &p->historybuffer[0]
495 505
496 506 @ Check loop count
497endofloop:
498@ Check loop count
499 ldr r0, [sp, #8] 507 ldr r0, [sp, #8]
500 subs r0, r0, #1 508 subs r0, r0, #1
501 strne r0, [sp, #8] 509 strne r0, [sp, #8]
502 bne loop 510 bne loop
503 511
504done: 512 b done
505 str r14, [r12] @ Save value of p->buf
506 add sp, sp, #12 @ Don't bother restoring r1-r3
507 ldmia sp!, {r4-r11, pc}