2007-01-28 21:32:08 +00:00
|
|
|
/*
|
|
|
|
* Simple IDCT
|
|
|
|
*
|
|
|
|
* Copyright (c) 2001 Michael Niedermayer <michaelni@gmx.at>
|
2007-07-05 20:08:51 +00:00
|
|
|
* Copyright (c) 2007 Mans Rullgard <mans@mansr.com>
|
2007-01-28 21:32:08 +00:00
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2008-10-27 00:25:09 +00:00
|
|
|
#include "asm.S"
|
|
|
|
|
2007-01-28 21:32:08 +00:00
|
|
|
#define W1 22725 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
|
|
|
|
#define W2 21407 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
|
|
|
|
#define W3 19266 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
|
|
|
|
#define W4 16383 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
|
|
|
|
#define W5 12873 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
|
|
|
|
#define W6 8867 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
|
|
|
|
#define W7 4520 /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
|
|
|
|
#define ROW_SHIFT 11
|
|
|
|
#define COL_SHIFT 20
|
|
|
|
|
|
|
|
#define W13 (W1 | (W3 << 16))
|
|
|
|
#define W26 (W2 | (W6 << 16))
|
|
|
|
#define W42 (W4 | (W2 << 16))
|
|
|
|
#define W42n (-W4&0xffff | (-W2 << 16))
|
|
|
|
#define W46 (W4 | (W6 << 16))
|
|
|
|
#define W57 (W5 | (W7 << 16))
|
|
|
|
|
|
|
|
.text
|
|
|
|
.align
|
|
|
|
w13: .long W13
|
|
|
|
w26: .long W26
|
|
|
|
w42: .long W42
|
|
|
|
w42n: .long W42n
|
|
|
|
w46: .long W46
|
|
|
|
w57: .long W57
|
|
|
|
|
|
|
|
/*
|
|
|
|
Compute partial IDCT of single row.
|
|
|
|
shift = left-shift amount
|
2009-01-12 20:37:29 +00:00
|
|
|
r0 = source address
|
|
|
|
r2 = row[2,0] <= 2 cycles
|
|
|
|
r3 = row[3,1]
|
2007-02-01 22:50:38 +00:00
|
|
|
ip = w42 <= 2 cycles
|
2007-01-28 21:32:08 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
Output in registers r4--r11
|
2007-01-28 21:32:08 +00:00
|
|
|
*/
|
|
|
|
.macro idct_row shift
|
2009-01-12 20:37:33 +00:00
|
|
|
ldr lr, w46 /* lr = W4 | (W6 << 16) */
|
2009-01-12 20:37:29 +00:00
|
|
|
mov r1, #(1<<(\shift-1))
|
|
|
|
smlad r4, r2, ip, r1
|
|
|
|
smlsd r7, r2, ip, r1
|
2009-01-12 20:37:33 +00:00
|
|
|
ldr ip, w13 /* ip = W1 | (W3 << 16) */
|
|
|
|
ldr r10,w57 /* r10 = W5 | (W7 << 16) */
|
2009-01-12 20:37:29 +00:00
|
|
|
smlad r5, r2, lr, r1
|
|
|
|
smlsd r6, r2, lr, r1
|
|
|
|
|
|
|
|
smuad r8, r3, ip /* r8 = B0 = W1*row[1] + W3*row[3] */
|
|
|
|
smusdx r11,r3, r10 /* r11 = B3 = W7*row[1] - W5*row[3] */
|
|
|
|
ldr lr, [r0, #12] /* lr = row[7,5] */
|
|
|
|
pkhtb r2, ip, r10,asr #16 /* r3 = W7 | (W3 << 16) */
|
|
|
|
pkhbt r1, ip, r10,lsl #16 /* r1 = W1 | (W5 << 16) */
|
|
|
|
smusdx r9, r2, r3 /* r9 = -B1 = W7*row[3] - W3*row[1] */
|
|
|
|
smlad r8, lr, r10,r8 /* B0 += W5*row[5] + W7*row[7] */
|
|
|
|
smusdx r10,r3, r1 /* r10 = B2 = W5*row[1] - W1*row[3] */
|
|
|
|
|
2009-01-12 20:37:33 +00:00
|
|
|
ldr r3, w42n /* r3 = -W4 | (-W2 << 16) */
|
2009-01-12 20:37:29 +00:00
|
|
|
smlad r10,lr, r2, r10 /* B2 += W7*row[5] + W3*row[7] */
|
|
|
|
ldr r2, [r0, #4] /* r2 = row[6,4] */
|
|
|
|
smlsdx r11,lr, ip, r11 /* B3 += W3*row[5] - W1*row[7] */
|
2009-01-12 20:37:33 +00:00
|
|
|
ldr ip, w46 /* ip = W4 | (W6 << 16) */
|
2009-01-12 20:37:29 +00:00
|
|
|
smlad r9, lr, r1, r9 /* B1 -= W1*row[5] + W5*row[7] */
|
2007-01-28 21:32:08 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
smlad r5, r2, r3, r5 /* A1 += -W4*row[4] - W2*row[6] */
|
|
|
|
smlsd r6, r2, r3, r6 /* A2 += -W4*row[4] + W2*row[6] */
|
|
|
|
smlad r4, r2, ip, r4 /* A0 += W4*row[4] + W6*row[6] */
|
|
|
|
smlsd r7, r2, ip, r7 /* A3 += W4*row[4] - W6*row[6] */
|
2007-01-28 21:32:08 +00:00
|
|
|
.endm
|
|
|
|
|
2007-01-31 23:04:56 +00:00
|
|
|
/*
|
|
|
|
Compute partial IDCT of half row.
|
|
|
|
shift = left-shift amount
|
2009-01-12 20:37:29 +00:00
|
|
|
r2 = row[2,0]
|
|
|
|
r3 = row[3,1]
|
2007-02-02 00:23:19 +00:00
|
|
|
ip = w42
|
2007-01-31 23:04:56 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
Output in registers r4--r11
|
2007-01-31 23:04:56 +00:00
|
|
|
*/
|
|
|
|
.macro idct_row4 shift
|
2009-01-12 20:37:33 +00:00
|
|
|
ldr lr, w46 /* lr = W4 | (W6 << 16) */
|
|
|
|
ldr r10,w57 /* r10 = W5 | (W7 << 16) */
|
2009-01-12 20:37:29 +00:00
|
|
|
mov r1, #(1<<(\shift-1))
|
|
|
|
smlad r4, r2, ip, r1
|
|
|
|
smlsd r7, r2, ip, r1
|
2009-01-12 20:37:33 +00:00
|
|
|
ldr ip, w13 /* ip = W1 | (W3 << 16) */
|
2009-01-12 20:37:29 +00:00
|
|
|
smlad r5, r2, lr, r1
|
|
|
|
smlsd r6, r2, lr, r1
|
|
|
|
smusdx r11,r3, r10 /* r11 = B3 = W7*row[1] - W5*row[3] */
|
|
|
|
smuad r8, r3, ip /* r8 = B0 = W1*row[1] + W3*row[3] */
|
|
|
|
pkhtb r2, ip, r10,asr #16 /* r3 = W7 | (W3 << 16) */
|
|
|
|
pkhbt r1, ip, r10,lsl #16 /* r1 = W1 | (W5 << 16) */
|
|
|
|
smusdx r9, r2, r3 /* r9 = -B1 = W7*row[3] - W3*row[1] */
|
|
|
|
smusdx r10,r3, r1 /* r10 = B2 = W5*row[1] - W1*row[3] */
|
2007-01-31 23:04:56 +00:00
|
|
|
.endm
|
|
|
|
|
2007-01-28 21:32:08 +00:00
|
|
|
/*
|
|
|
|
Compute final part of IDCT single row without shift.
|
2009-01-12 20:37:29 +00:00
|
|
|
Input in registers r4--r11
|
|
|
|
Output in registers ip, r4--r6, lr, r8--r10
|
2007-01-28 21:32:08 +00:00
|
|
|
*/
|
|
|
|
.macro idct_finish
|
2009-01-12 20:37:29 +00:00
|
|
|
add ip, r4, r8 /* r1 = A0 + B0 */
|
|
|
|
sub lr, r4, r8 /* r2 = A0 - B0 */
|
|
|
|
sub r4, r5, r9 /* r2 = A1 + B1 */
|
|
|
|
add r8, r5, r9 /* r2 = A1 - B1 */
|
|
|
|
add r5, r6, r10 /* r1 = A2 + B2 */
|
|
|
|
sub r9, r6, r10 /* r1 = A2 - B2 */
|
|
|
|
add r6, r7, r11 /* r2 = A3 + B3 */
|
|
|
|
sub r10,r7, r11 /* r2 = A3 - B3 */
|
2007-01-28 21:32:08 +00:00
|
|
|
.endm
|
|
|
|
|
|
|
|
/*
|
|
|
|
Compute final part of IDCT single row.
|
|
|
|
shift = right-shift amount
|
2009-01-12 20:37:29 +00:00
|
|
|
Input/output in registers r4--r11
|
2007-01-28 21:32:08 +00:00
|
|
|
*/
|
|
|
|
.macro idct_finish_shift shift
|
2009-01-12 20:37:29 +00:00
|
|
|
add r3, r4, r8 /* r3 = A0 + B0 */
|
|
|
|
sub r2, r4, r8 /* r2 = A0 - B0 */
|
|
|
|
mov r4, r3, asr #\shift
|
|
|
|
mov r8, r2, asr #\shift
|
|
|
|
|
|
|
|
sub r3, r5, r9 /* r3 = A1 + B1 */
|
|
|
|
add r2, r5, r9 /* r2 = A1 - B1 */
|
|
|
|
mov r5, r3, asr #\shift
|
|
|
|
mov r9, r2, asr #\shift
|
|
|
|
|
|
|
|
add r3, r6, r10 /* r3 = A2 + B2 */
|
|
|
|
sub r2, r6, r10 /* r2 = A2 - B2 */
|
|
|
|
mov r6, r3, asr #\shift
|
|
|
|
mov r10,r2, asr #\shift
|
|
|
|
|
|
|
|
add r3, r7, r11 /* r3 = A3 + B3 */
|
|
|
|
sub r2, r7, r11 /* r2 = A3 - B3 */
|
|
|
|
mov r7, r3, asr #\shift
|
|
|
|
mov r11,r2, asr #\shift
|
2007-01-28 21:32:08 +00:00
|
|
|
.endm
|
|
|
|
|
|
|
|
/*
|
|
|
|
Compute final part of IDCT single row, saturating results at 8 bits.
|
|
|
|
shift = right-shift amount
|
2009-01-12 20:37:29 +00:00
|
|
|
Input/output in registers r4--r11
|
2007-01-28 21:32:08 +00:00
|
|
|
*/
|
|
|
|
.macro idct_finish_shift_sat shift
|
2009-01-12 20:37:29 +00:00
|
|
|
add r3, r4, r8 /* r3 = A0 + B0 */
|
|
|
|
sub ip, r4, r8 /* ip = A0 - B0 */
|
|
|
|
usat r4, #8, r3, asr #\shift
|
|
|
|
usat r8, #8, ip, asr #\shift
|
|
|
|
|
|
|
|
sub r3, r5, r9 /* r3 = A1 + B1 */
|
|
|
|
add ip, r5, r9 /* ip = A1 - B1 */
|
|
|
|
usat r5, #8, r3, asr #\shift
|
|
|
|
usat r9, #8, ip, asr #\shift
|
|
|
|
|
|
|
|
add r3, r6, r10 /* r3 = A2 + B2 */
|
|
|
|
sub ip, r6, r10 /* ip = A2 - B2 */
|
|
|
|
usat r6, #8, r3, asr #\shift
|
|
|
|
usat r10,#8, ip, asr #\shift
|
|
|
|
|
|
|
|
add r3, r7, r11 /* r3 = A3 + B3 */
|
|
|
|
sub ip, r7, r11 /* ip = A3 - B3 */
|
|
|
|
usat r7, #8, r3, asr #\shift
|
|
|
|
usat r11,#8, ip, asr #\shift
|
2007-01-28 21:32:08 +00:00
|
|
|
.endm
|
|
|
|
|
|
|
|
/*
|
|
|
|
Compute IDCT of single row, storing as column.
|
2009-01-12 20:37:29 +00:00
|
|
|
r0 = source
|
|
|
|
r1 = dest
|
2007-01-28 21:32:08 +00:00
|
|
|
*/
|
2008-10-27 00:25:09 +00:00
|
|
|
function idct_row_armv6
|
2007-02-05 21:18:11 +00:00
|
|
|
str lr, [sp, #-4]!
|
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
ldr lr, [r0, #12] /* lr = row[7,5] */
|
|
|
|
ldr ip, [r0, #4] /* ip = row[6,4] */
|
|
|
|
ldr r3, [r0, #8] /* r3 = row[3,1] */
|
|
|
|
ldr r2, [r0] /* r2 = row[2,0] */
|
2007-02-05 21:18:11 +00:00
|
|
|
orrs lr, lr, ip
|
2009-01-12 20:37:29 +00:00
|
|
|
cmpeq lr, r3
|
|
|
|
cmpeq lr, r2, lsr #16
|
2007-01-31 23:04:56 +00:00
|
|
|
beq 1f
|
2009-01-12 20:37:29 +00:00
|
|
|
str r1, [sp, #-4]!
|
2009-01-12 20:37:33 +00:00
|
|
|
ldr ip, w42 /* ip = W4 | (W2 << 16) */
|
2007-02-05 21:18:11 +00:00
|
|
|
cmp lr, #0
|
|
|
|
beq 2f
|
2007-02-05 21:16:31 +00:00
|
|
|
|
2007-02-05 21:18:11 +00:00
|
|
|
idct_row ROW_SHIFT
|
|
|
|
b 3f
|
2007-02-05 21:16:31 +00:00
|
|
|
|
2007-02-05 21:18:11 +00:00
|
|
|
2: idct_row4 ROW_SHIFT
|
2007-01-31 23:04:56 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
3: ldr r1, [sp], #4
|
2007-02-05 21:18:11 +00:00
|
|
|
idct_finish_shift ROW_SHIFT
|
2007-01-28 21:32:08 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
strh r4, [r1]
|
|
|
|
strh r5, [r1, #(16*2)]
|
|
|
|
strh r6, [r1, #(16*4)]
|
|
|
|
strh r7, [r1, #(16*6)]
|
|
|
|
strh r11,[r1, #(16*1)]
|
|
|
|
strh r10,[r1, #(16*3)]
|
|
|
|
strh r9, [r1, #(16*5)]
|
|
|
|
strh r8, [r1, #(16*7)]
|
2007-01-28 21:32:08 +00:00
|
|
|
|
|
|
|
ldr pc, [sp], #4
|
2007-01-31 23:04:56 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
1: mov r2, r2, lsl #3
|
|
|
|
strh r2, [r1]
|
|
|
|
strh r2, [r1, #(16*2)]
|
|
|
|
strh r2, [r1, #(16*4)]
|
|
|
|
strh r2, [r1, #(16*6)]
|
|
|
|
strh r2, [r1, #(16*1)]
|
|
|
|
strh r2, [r1, #(16*3)]
|
|
|
|
strh r2, [r1, #(16*5)]
|
|
|
|
strh r2, [r1, #(16*7)]
|
2007-02-05 21:18:11 +00:00
|
|
|
ldr pc, [sp], #4
|
2007-01-28 21:32:08 +00:00
|
|
|
.endfunc
|
|
|
|
|
|
|
|
/*
|
|
|
|
Compute IDCT of single column, read as row.
|
2009-01-12 20:37:29 +00:00
|
|
|
r0 = source
|
|
|
|
r1 = dest
|
2007-01-28 21:32:08 +00:00
|
|
|
*/
|
2008-10-27 00:25:09 +00:00
|
|
|
function idct_col_armv6
|
2009-01-12 20:37:29 +00:00
|
|
|
stmfd sp!, {r1, lr}
|
2007-01-28 21:32:08 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
ldr r2, [r0] /* r2 = row[2,0] */
|
2009-01-12 20:37:33 +00:00
|
|
|
ldr ip, w42 /* ip = W4 | (W2 << 16) */
|
2009-01-12 20:37:29 +00:00
|
|
|
ldr r3, [r0, #8] /* r3 = row[3,1] */
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_row COL_SHIFT
|
2009-01-12 20:37:29 +00:00
|
|
|
ldr r1, [sp], #4
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_finish_shift COL_SHIFT
|
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
strh r4, [r1]
|
|
|
|
strh r5, [r1, #(16*1)]
|
|
|
|
strh r6, [r1, #(16*2)]
|
|
|
|
strh r7, [r1, #(16*3)]
|
|
|
|
strh r11,[r1, #(16*4)]
|
|
|
|
strh r10,[r1, #(16*5)]
|
|
|
|
strh r9, [r1, #(16*6)]
|
|
|
|
strh r8, [r1, #(16*7)]
|
2007-01-28 21:32:08 +00:00
|
|
|
|
|
|
|
ldr pc, [sp], #4
|
|
|
|
.endfunc
|
|
|
|
|
|
|
|
/*
|
|
|
|
Compute IDCT of single column, read as row, store saturated 8-bit.
|
2009-01-12 20:37:29 +00:00
|
|
|
r0 = source
|
|
|
|
r1 = dest
|
|
|
|
r2 = line size
|
2007-01-28 21:32:08 +00:00
|
|
|
*/
|
2008-10-27 00:25:09 +00:00
|
|
|
function idct_col_put_armv6
|
2009-01-12 20:37:29 +00:00
|
|
|
stmfd sp!, {r1, r2, lr}
|
2007-01-28 21:32:08 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
ldr r2, [r0] /* r2 = row[2,0] */
|
2009-01-12 20:37:33 +00:00
|
|
|
ldr ip, w42 /* ip = W4 | (W2 << 16) */
|
2009-01-12 20:37:29 +00:00
|
|
|
ldr r3, [r0, #8] /* r3 = row[3,1] */
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_row COL_SHIFT
|
2009-01-12 20:37:29 +00:00
|
|
|
ldmfd sp!, {r1, r2}
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_finish_shift_sat COL_SHIFT
|
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
strb r4, [r1], r2
|
|
|
|
strb r5, [r1], r2
|
|
|
|
strb r6, [r1], r2
|
|
|
|
strb r7, [r1], r2
|
|
|
|
strb r11,[r1], r2
|
|
|
|
strb r10,[r1], r2
|
|
|
|
strb r9, [r1], r2
|
|
|
|
strb r8, [r1], r2
|
2007-01-28 21:32:08 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
sub r1, r1, r2, lsl #3
|
2007-01-28 21:32:08 +00:00
|
|
|
|
|
|
|
ldr pc, [sp], #4
|
|
|
|
.endfunc
|
|
|
|
|
|
|
|
/*
|
|
|
|
Compute IDCT of single column, read as row, add/store saturated 8-bit.
|
2009-01-12 20:37:29 +00:00
|
|
|
r0 = source
|
|
|
|
r1 = dest
|
|
|
|
r2 = line size
|
2007-01-28 21:32:08 +00:00
|
|
|
*/
|
2008-10-27 00:25:09 +00:00
|
|
|
function idct_col_add_armv6
|
2009-01-12 20:37:29 +00:00
|
|
|
stmfd sp!, {r1, r2, lr}
|
2007-01-28 21:32:08 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
ldr r2, [r0] /* r2 = row[2,0] */
|
2009-01-12 20:37:33 +00:00
|
|
|
ldr ip, w42 /* ip = W4 | (W2 << 16) */
|
2009-01-12 20:37:29 +00:00
|
|
|
ldr r3, [r0, #8] /* r3 = row[3,1] */
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_row COL_SHIFT
|
2009-01-12 20:37:29 +00:00
|
|
|
ldmfd sp!, {r1, r2}
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_finish
|
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
ldrb r3, [r1]
|
|
|
|
ldrb r7, [r1, r2]
|
|
|
|
ldrb r11,[r1, r2, lsl #2]
|
|
|
|
add ip, r3, ip, asr #COL_SHIFT
|
2007-01-28 21:32:08 +00:00
|
|
|
usat ip, #8, ip
|
2009-01-12 20:37:29 +00:00
|
|
|
add r4, r7, r4, asr #COL_SHIFT
|
|
|
|
strb ip, [r1], r2
|
|
|
|
ldrb ip, [r1, r2]
|
|
|
|
usat r4, #8, r4
|
|
|
|
ldrb r11,[r1, r2, lsl #2]
|
|
|
|
add r5, ip, r5, asr #COL_SHIFT
|
|
|
|
usat r5, #8, r5
|
|
|
|
strb r4, [r1], r2
|
|
|
|
ldrb r3, [r1, r2]
|
|
|
|
ldrb ip, [r1, r2, lsl #2]
|
|
|
|
strb r5, [r1], r2
|
|
|
|
ldrb r7, [r1, r2]
|
|
|
|
ldrb r4, [r1, r2, lsl #2]
|
|
|
|
add r6, r3, r6, asr #COL_SHIFT
|
|
|
|
usat r6, #8, r6
|
|
|
|
add r10,r7, r10,asr #COL_SHIFT
|
|
|
|
usat r10,#8, r10
|
|
|
|
add r9, r11,r9, asr #COL_SHIFT
|
|
|
|
usat r9, #8, r9
|
|
|
|
add r8, ip, r8, asr #COL_SHIFT
|
|
|
|
usat r8, #8, r8
|
|
|
|
add lr, r4, lr, asr #COL_SHIFT
|
2007-01-28 21:32:08 +00:00
|
|
|
usat lr, #8, lr
|
2009-01-12 20:37:29 +00:00
|
|
|
strb r6, [r1], r2
|
|
|
|
strb r10,[r1], r2
|
|
|
|
strb r9, [r1], r2
|
|
|
|
strb r8, [r1], r2
|
|
|
|
strb lr, [r1], r2
|
2007-01-28 21:32:08 +00:00
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
sub r1, r1, r2, lsl #3
|
2007-01-28 21:32:08 +00:00
|
|
|
|
|
|
|
ldr pc, [sp], #4
|
|
|
|
.endfunc
|
|
|
|
|
|
|
|
/*
|
|
|
|
Compute 8 IDCT row transforms.
|
|
|
|
func = IDCT row->col function
|
|
|
|
width = width of columns in bytes
|
|
|
|
*/
|
|
|
|
.macro idct_rows func width
|
|
|
|
bl \func
|
2009-01-12 20:37:29 +00:00
|
|
|
add r0, r0, #(16*2)
|
|
|
|
add r1, r1, #\width
|
2007-01-28 21:32:08 +00:00
|
|
|
bl \func
|
2009-01-12 20:37:29 +00:00
|
|
|
add r0, r0, #(16*2)
|
|
|
|
add r1, r1, #\width
|
2007-01-28 21:32:08 +00:00
|
|
|
bl \func
|
2009-01-12 20:37:29 +00:00
|
|
|
add r0, r0, #(16*2)
|
|
|
|
add r1, r1, #\width
|
2007-01-28 21:32:08 +00:00
|
|
|
bl \func
|
2009-01-12 20:37:29 +00:00
|
|
|
sub r0, r0, #(16*5)
|
|
|
|
add r1, r1, #\width
|
2007-01-28 21:32:08 +00:00
|
|
|
bl \func
|
2009-01-12 20:37:29 +00:00
|
|
|
add r0, r0, #(16*2)
|
|
|
|
add r1, r1, #\width
|
2007-01-28 21:32:08 +00:00
|
|
|
bl \func
|
2009-01-12 20:37:29 +00:00
|
|
|
add r0, r0, #(16*2)
|
|
|
|
add r1, r1, #\width
|
2007-01-28 21:32:08 +00:00
|
|
|
bl \func
|
2009-01-12 20:37:29 +00:00
|
|
|
add r0, r0, #(16*2)
|
|
|
|
add r1, r1, #\width
|
2007-01-28 21:32:08 +00:00
|
|
|
bl \func
|
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
sub r0, r0, #(16*7)
|
2007-01-28 21:32:08 +00:00
|
|
|
.endm
|
|
|
|
|
|
|
|
/* void ff_simple_idct_armv6(DCTELEM *data); */
|
2008-10-27 00:25:09 +00:00
|
|
|
function ff_simple_idct_armv6, export=1
|
2009-01-12 20:37:29 +00:00
|
|
|
stmfd sp!, {r4-r11, lr}
|
2007-01-28 21:32:08 +00:00
|
|
|
sub sp, sp, #128
|
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
mov r1, sp
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_rows idct_row_armv6, 2
|
2009-01-12 20:37:29 +00:00
|
|
|
mov r1, r0
|
|
|
|
mov r0, sp
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_rows idct_col_armv6, 2
|
|
|
|
|
|
|
|
add sp, sp, #128
|
2009-01-12 20:37:29 +00:00
|
|
|
ldmfd sp!, {r4-r11, pc}
|
2007-01-28 21:32:08 +00:00
|
|
|
.endfunc
|
|
|
|
|
|
|
|
/* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data); */
|
2008-10-27 00:25:09 +00:00
|
|
|
function ff_simple_idct_add_armv6, export=1
|
2009-01-12 20:37:29 +00:00
|
|
|
stmfd sp!, {r0, r1, r4-r11, lr}
|
2007-01-28 21:32:08 +00:00
|
|
|
sub sp, sp, #128
|
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
mov r0, r2
|
|
|
|
mov r1, sp
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_rows idct_row_armv6, 2
|
2009-01-12 20:37:29 +00:00
|
|
|
mov r0, sp
|
|
|
|
ldr r1, [sp, #128]
|
|
|
|
ldr r2, [sp, #(128+4)]
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_rows idct_col_add_armv6, 1
|
|
|
|
|
|
|
|
add sp, sp, #(128+8)
|
2009-01-12 20:37:29 +00:00
|
|
|
ldmfd sp!, {r4-r11, pc}
|
2007-01-28 21:32:08 +00:00
|
|
|
.endfunc
|
|
|
|
|
|
|
|
/* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data); */
|
2008-10-27 00:25:09 +00:00
|
|
|
function ff_simple_idct_put_armv6, export=1
|
2009-01-12 20:37:29 +00:00
|
|
|
stmfd sp!, {r0, r1, r4-r11, lr}
|
2007-01-28 21:32:08 +00:00
|
|
|
sub sp, sp, #128
|
|
|
|
|
2009-01-12 20:37:29 +00:00
|
|
|
mov r0, r2
|
|
|
|
mov r1, sp
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_rows idct_row_armv6, 2
|
2009-01-12 20:37:29 +00:00
|
|
|
mov r0, sp
|
|
|
|
ldr r1, [sp, #128]
|
|
|
|
ldr r2, [sp, #(128+4)]
|
2007-01-28 21:32:08 +00:00
|
|
|
idct_rows idct_col_put_armv6, 1
|
|
|
|
|
|
|
|
add sp, sp, #(128+8)
|
2009-01-12 20:37:29 +00:00
|
|
|
ldmfd sp!, {r4-r11, pc}
|
2007-01-28 21:32:08 +00:00
|
|
|
.endfunc
|