2 * Copyright (C) 2010 Mans Rullgard
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 .macro rac_get_prob h, bs, buf, cw, pr, t0, t1
30 ldrhcs \t1, [\buf], #2
31 smlabb \h, \t0, \pr, \h
33 orrcs \cw, \cw, \t1, lsl \bs
37 subge \cw, \cw, \h, lsl #16
41 .macro rac_get_128 h, bs, buf, cw, t0, t1
45 ldrhcs \t1, [\buf], #2
48 add \h, \h, \t0, lsl #7
49 orrcs \cw, \cw, \t1, lsl \bs
53 subge \cw, \cw, \h, lsl #16
57 function ff_decode_block_coeffs_armv6, export=1
58 push {r0,r1,r4-r11,lr}
59 movrel lr, X(ff_vp56_norm_shift)
60 ldrd r4, r5, [sp, #44] @ token_prob, qmul
63 ldm r0, {r5-r7} @ high, bits, buf
64 pkhtbne r11, r11, r11, asr #16
65 ldr r8, [r0, #16] @ code_word
70 rac_get_prob r5, r6, r7, r8, r0, r9, r10
75 rac_get_prob r5, r6, r7, r8, r0, r9, r10
79 add r4, r3, r3, lsl #5
89 add r5, r5, r9, lsl #7
90 orrcs r8, r8, r10, lsl r6
94 movrel r10, zigzag_scan-1
95 subge r8, r8, r5, lsl #16
105 rac_get_prob r5, r6, r7, r8, r0, r9, r10
106 pkhtb r11, r11, r11, asr #16
114 stm r0, {r5-r7} @ high, bits, buf
115 str r8, [r0, #16] @ code_word
121 add r4, r3, r3, lsl #5
124 pkhtb r11, r11, r11, asr #16
129 rac_get_prob r5, r6, r7, r8, r0, r9, r10
135 rac_get_prob r5, r6, r7, r8, r0, r9, r10
140 rac_get_prob r5, r6, r7, r8, r0, r9, r10
146 rac_get_prob r5, r6, r7, r8, r0, r9, r10
151 rac_get_prob r5, r6, r7, r8, r0, r9, r10
157 rac_get_prob r5, r6, r7, r8, r0, r9, r10
164 rac_get_prob r5, r6, r7, r8, r0, r9, r10
168 rac_get_prob r5, r6, r7, r8, r0, r9, r10
174 rac_get_prob r5, r6, r7, r8, r0, r9, r10
180 rac_get_prob r5, r6, r7, r8, r0, r9, r10
183 movrel r4, X(ff_vp8_dct_cat_prob)
185 ldr r4, [r4, r12, lsl #2]
192 rac_get_prob r5, r6, r7, r8, r0, r9, r10
201 add r4, r3, r3, lsl #5
204 rac_get_128 r5, r6, r7, r8, r9, r10
207 movrel r9, zigzag_scan-1