Commit 08eed049 authored by Fritz Koenig's avatar Fritz Koenig Committed by John Koleszar

Remove CONFIG_NEW_TOKENS files.

These files were out of date and no longer maintained.
Token decoding has implemented the no-crash code which
is incompatible with this arm assembly code.

Change-Id: Ibf729886c56fca48181af60b44bda896c30023fc
parent b791dca9
......@@ -230,7 +230,6 @@ CONFIG_LIST="
dequant_tokens
dc_recon
new_tokens
runtime_cpu_detect
postproc
multithread
......@@ -269,7 +268,6 @@ CMDLINE_SELECT="
dequant_tokens
dc_recon
new_tokens
postproc
multithread
psnr
......
This diff is collapsed.
;
; Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vp8_decode_mb_tokens_v5|
AREA |.text|, CODE, READONLY ; name this block of code
INCLUDE vpx_asm_offsets.asm
l_qcoeff EQU 0
l_i EQU 4
l_type EQU 8
l_stop EQU 12
l_c EQU 16
l_l_ptr EQU 20
l_a_ptr EQU 24
l_bc EQU 28
l_coef_ptr EQU 32
l_stacksize EQU 64
;; constant offsets -- these should be created at build time
c_onyxblock2left_offset EQU 25
c_onyxblock2above_offset EQU 50
c_entropy_nodes EQU 11
c_dct_eob_token EQU 11
|vp8_decode_mb_tokens_v5| PROC
stmdb sp!, {r4 - r11, lr}
sub sp, sp, #l_stacksize
mov r7, r1
mov r9, r0 ;DETOK *detoken
ldr r1, [r9, #detok_current_bc]
ldr r0, [r9, #detok_qcoeff_start_ptr]
mov r11, #0
mov r3, #0x10
cmp r7, #1
addeq r11, r11, #24
addeq r3, r3, #8
addeq r0, r0, #3, 24
str r0, [sp, #l_qcoeff]
str r11, [sp, #l_i]
str r7, [sp, #l_type]
str r3, [sp, #l_stop]
str r1, [sp, #l_bc]
add lr, r9, r7, lsl #2
ldr r2, [r1, #bool_decoder_buffer]
ldr r3, [r1, #bool_decoder_pos]
ldr r10, [lr, #detok_coef_probs]
ldr r5, [r1, #bool_decoder_count]
ldr r6, [r1, #bool_decoder_range]
ldr r4, [r1, #bool_decoder_value]
add r8, r2, r3
str r10, [sp, #l_coef_ptr]
;align 4
BLOCK_LOOP
ldr r3, [r9, #detok_ptr_onyxblock2context_leftabove]
ldr r2, [r9, #DETOK_A]
ldr r1, [r9, #DETOK_L]
ldrb r12, [r3, +r11] ; detoken->ptr_onyxblock2context_leftabove[i]
cmp r7, #0 ; check type
moveq r7, #1
movne r7, #0
ldr r0, [r2, +r12, lsl #2] ; a
add r1, r1, r12, lsl #4
add r3, r3, r11
ldrb r2, [r3, #c_onyxblock2above_offset]
ldrb r3, [r3, #c_onyxblock2left_offset]
mov lr, #c_entropy_nodes
;; ;++
ldr r2, [r0, +r2, lsl #2]!
add r3, r1, r3, lsl #2
str r3, [sp, #l_l_ptr]
ldr r3, [r3]
cmp r2, #0
movne r2, #1
cmp r3, #0
addne r2, r2, #1
str r0, [sp, #l_a_ptr]
smlabb r0, r2, lr, r10
mov r1, #0 ; t = 0
str r7, [sp, #l_c]
;align 4
COEFF_LOOP
ldr r3, [r9, #detok_ptr_onyx_coef_bands_x]
ldr lr, [r9, #detok_onyx_coef_tree_ptr]
;;the following two lines are used if onyx_coef_bands_x is UINT16
;; add r3, r3, r7, lsl #1
;; ldrh r3, [r3]
;;the following line is used if onyx_coef_bands_x is UINT8
ldrb r3, [r7, +r3]
;; ;++
;; pld [r8]
;++
add r0, r0, r3
;align 4
get_token_loop
ldrb r2, [r0, +r1, asr #1]
mov r3, r6, lsl #8
sub r3, r3, #256 ;split = 1 + (((range-1) * probability) >> 8)
mov r10, #1
smlawb r2, r3, r2, r10
ldrb r12, [r8] ;load cx data byte in stall slot
;++
subs r3, r4, r2, lsl #24 ;x = value-(split<<24)
addhs r1, r1, #1 ;t += 1
movhs r4, r3 ;update value
subhs r2, r6, r2 ;range = range - split
movlo r6, r2
;;; ldrsbhs r1, [r1, +lr]
ldrsb r1, [r1, +lr]
;; use branch for short pipelines ???
;; cmp r2, #0x80
;; bcs |$LN22@decode_mb_to|
clz r3, r2
sub r3, r3, #24
subs r5, r5, r3
mov r6, r2, lsl r3
mov r4, r4, lsl r3
;; use branch for short pipelines ???
;; bgt |$LN22@decode_mb_to|
addle r5, r5, #8
rsble r3, r5, #8
addle r8, r8, #1
orrle r4, r4, r12, lsl r3
;;|$LN22@decode_mb_to|
cmp r1, #0
bgt get_token_loop
cmn r1, #c_dct_eob_token ;if(t == -DCT_EOB_TOKEN)
beq END_OF_BLOCK
rsb lr, r1, #0 ;v = -t;
cmp lr, #4 ;if(v > FOUR_TOKEN)
ble SKIP_EXTRABITS
ldr r3, [r9, #detok_teb_base_ptr]
mov r11, #1
add r7, r3, lr, lsl #4
ldrsh lr, [r7, #tokenextrabits_min_val];v = teb_ptr->min_val
ldrsh r0, [r7, #tokenextrabits_length];bits_count = teb_ptr->Length
extrabits_loop
add r3, r0, r7
ldrb r2, [r3, #4]
mov r3, r6, lsl #8
sub r3, r3, #256 ;split = 1 + (((range-1) * probability) >> 8)
mov r10, #1
smlawb r2, r3, r2, r10
ldrb r12, [r8]
;++
subs r10, r4, r2, lsl #24 ;x = value-(split<<24)
movhs r4, r10 ;update value
subhs r2, r6, r2 ;range = range - split
addhs lr, lr, r11, lsl r0 ;v += ((UINT16)1<<bits_count)
movlo r6, r2 ;range = split
;; use branch for short pipelines ???
;; cmp r2, #0x80
;; bcs |$LN10@decode_mb_to|
clz r3, r2
sub r3, r3, #24
subs r5, r5, r3
mov r6, r2, lsl r3 ;range
mov r4, r4, lsl r3 ;value
addle r5, r5, #8
addle r8, r8, #1
rsble r3, r5, #8
orrle r4, r4, r12, lsl r3
;;|$LN10@decode_mb_to|
subs r0, r0, #1
bpl extrabits_loop
SKIP_EXTRABITS
ldr r11, [sp, #l_qcoeff]
ldr r0, [sp, #l_coef_ptr]
cmp r1, #0 ;check for nonzero token
beq SKIP_EOB_CHECK ;if t is zero, we will skip the eob table chec
sub r3, r6, #1 ;range - 1
;++
mov r3, r3, lsl #7 ; *= onyx_prob_half (128)
;++
mov r3, r3, lsr #8
add r2, r3, #1 ;split
subs r3, r4, r2, lsl #24 ;x = value-(split<<24)
movhs r4, r3 ;update value
subhs r2, r6, r2 ;range = range - split
mvnhs r3, lr
addhs lr, r3, #1 ;v = (v ^ -1) + 1
movlo r6, r2 ;range = split
;; use branch for short pipelines ???
;; cmp r2, #0x80
;; bcs |$LN6@decode_mb_to|
clz r3, r2
sub r3, r3, #24
subs r5, r5, r3
mov r6, r2, lsl r3
mov r4, r4, lsl r3
ldrleb r2, [r8], #1
addle r5, r5, #8
rsble r3, r5, #8
orrle r4, r4, r2, lsl r3
;;|$LN6@decode_mb_to|
add r0, r0, #0xB
cmn r1, #1
addlt r0, r0, #0xB
mvn r1, #1
SKIP_EOB_CHECK
ldr r7, [sp, #l_c]
ldr r3, [r9, #detok_scan]
add r1, r1, #2
cmp r7, #(0x10 - 1) ;assume one less for now.... increment below
ldr r3, [r3, +r7, lsl #2]
add r7, r7, #1
add r3, r11, r3, lsl #1
str r7, [sp, #l_c]
strh lr, [r3]
blt COEFF_LOOP
sub r7, r7, #1 ;if(t != -DCT_EOB_TOKEN) --c
END_OF_BLOCK
ldr r3, [sp, #l_type]
ldr r10, [sp, #l_coef_ptr]
ldr r0, [sp, #l_qcoeff]
ldr r11, [sp, #l_i]
ldr r12, [sp, #l_stop]
cmp r3, #0
moveq r1, #1
movne r1, #0
add r3, r11, r9
cmp r7, r1
strb r7, [r3, #detok_eob]
ldr r7, [sp, #l_l_ptr]
ldr r2, [sp, #l_a_ptr]
movne r3, #1
moveq r3, #0
add r0, r0, #0x20
add r11, r11, #1
str r3, [r7]
str r3, [r2]
str r0, [sp, #l_qcoeff]
str r11, [sp, #l_i]
cmp r11, r12 ;i >= stop ?
ldr r7, [sp, #l_type]
mov lr, #0xB
blt BLOCK_LOOP
cmp r11, #0x19
bne ln2_decode_mb_to
ldr r12, [r9, #detok_qcoeff_start_ptr]
ldr r10, [r9, #detok_coef_probs]
mov r7, #0
mov r3, #0x10
str r12, [sp, #l_qcoeff]
str r7, [sp, #l_i]
str r7, [sp, #l_type]
str r3, [sp, #l_stop]
str r10, [sp, #l_coef_ptr]
b BLOCK_LOOP
ln2_decode_mb_to
cmp r11, #0x10
bne ln1_decode_mb_to
ldr r10, [r9, #0x30]
mov r7, #2
mov r3, #0x18
str r7, [sp, #l_type]
str r3, [sp, #l_stop]
str r10, [sp, #l_coef_ptr]
b BLOCK_LOOP
ln1_decode_mb_to
ldr r2, [sp, #l_bc]
mov r0, #0
nop
ldr r3, [r2, #bool_decoder_buffer]
str r5, [r2, #bool_decoder_count]
str r4, [r2, #bool_decoder_value]
sub r3, r8, r3
str r3, [r2, #bool_decoder_pos]
str r6, [r2, #bool_decoder_range]
add sp, sp, #l_stacksize
ldmia sp!, {r4 - r11, pc}
ENDP ; |vp8_decode_mb_tokens_v5|
END
/*
* Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "onyxc_int.h"
#include "postproc.h"
#include "onyxd.h"
#include "onyxd_int.h"
#include "vpx_mem/vpx_mem.h"
#include "alloccommon.h"
#include "vpx_scale/yv12extend.h"
#include "loopfilter.h"
#include "swapyv12buffer.h"
#include "g_common.h"
#include "threading.h"
#include "decoderthreading.h"
#include <stdio.h>
#include "segmentation_common.h"
#include "quant_common.h"
#include "vpx_scale/vpxscale.h"
#include "systemdependent.h"
#include "vpx_ports/vpx_timer.h"
#ifndef VPX_NO_GLOBALS
static int init_ct = 0;
#else
# include "vpx_global_handling.h"
# define init_ct ((int)vpxglobalm(onyxd,init_ct))
#endif
extern void vp8_init_loop_filter(VP8_COMMON *cm);
extern void vp8cx_init_de_quantizer(VP8D_COMP *pbi);
extern void init_detokenizer(VP8D_COMP *dx);
// DEBUG code
void vp8_recon_write_yuv_frame(unsigned char *name, YV12_BUFFER_CONFIG *s)
{
FILE *yuv_file = fopen((char *)name, "ab");
unsigned char *src = s->y_buffer;
int h = s->y_height;
do
{
fwrite(src, s->y_width, 1, yuv_file);
src += s->y_stride;
}
while (--h);
src = s->u_buffer;
h = s->uv_height;
do
{
fwrite(src, s->uv_width, 1, yuv_file);
src += s->uv_stride;
}
while (--h);
src = s->v_buffer;
h = s->uv_height;
do
{
fwrite(src, s->uv_width, 1, yuv_file);
src += s->uv_stride;
}
while (--h);
fclose(yuv_file);
}
void vp8dx_initialize()
{
if (!init_ct++)
{
vp8_initialize_common();
vp8_scale_machine_specific_config();
}
}
void vp8dx_shutdown()
{
if (!--init_ct)
{
vp8_shutdown_common();
}
}
VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
{
VP8D_COMP *pbi = vpx_memalign(32, sizeof(VP8D_COMP));
if (!pbi)
return NULL;
vpx_memset(pbi, 0, sizeof(VP8D_COMP));
vp8dx_initialize();
vp8_create_common(&pbi->common);
vp8_dmachine_specific_config(pbi);
pbi->common.current_video_frame = 0;
pbi->ready_for_new_data = 1;
pbi->CPUFreq = 0; //vp8_get_processor_freq();
pbi->max_threads = oxcf->max_threads;
vp8_decoder_create_threads(pbi);
//vp8cx_init_de_quantizer() is first called here. Add check in frame_init_dequantizer() to avoid
// unnecessary calling of vp8cx_init_de_quantizer() for every frame.
vp8cx_init_de_quantizer(pbi);
{
VP8_COMMON *cm = &pbi->common;
vp8_init_loop_filter(cm);
cm->last_frame_type = KEY_FRAME;
cm->last_filter_type = cm->filter_type;
cm->last_sharpness_level = cm->sharpness_level;
}
init_detokenizer(pbi);
return (VP8D_PTR) pbi;
}
void vp8dx_remove_decompressor(VP8D_PTR ptr)
{
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
if (!pbi)
return;
vp8_decoder_remove_threads(pbi);
vp8_remove_common(&pbi->common);
vpx_free(pbi);
vp8dx_shutdown();
}
void vp8dx_set_setting(VP8D_PTR comp, VP8D_SETTING oxst, int x)
{
VP8D_COMP *pbi = (VP8D_COMP *) comp;
(void) pbi;
(void) x;
switch (oxst)
{
case VP8D_OK:
break;
}
}
int vp8dx_get_setting(VP8D_PTR comp, VP8D_SETTING oxst)
{
VP8D_COMP *pbi = (VP8D_COMP *) comp;
(void) pbi;
switch (oxst)
{
case VP8D_OK:
break;
}
return -1;
}
int vp8dx_get_reference(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd)
{
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
VP8_COMMON *cm = &pbi->common;
if (ref_frame_flag == VP8_LAST_FLAG)
vp8_yv12_copy_frame_ptr(&cm->last_frame, sd);
else if (ref_frame_flag == VP8_GOLD_FLAG)
vp8_yv12_copy_frame_ptr(&cm->golden_frame, sd);
else if (ref_frame_flag == VP8_ALT_FLAG)
vp8_yv12_copy_frame_ptr(&cm->alt_ref_frame, sd);
else
return -1;
return 0;
}
int vp8dx_set_reference(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd)
{
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
VP8_COMMON *cm = &pbi->common;
if (ref_frame_flag == VP8_LAST_FLAG)
vp8_yv12_copy_frame_ptr(sd, &cm->last_frame);
else if (ref_frame_flag == VP8_GOLD_FLAG)
vp8_yv12_copy_frame_ptr(sd, &cm->golden_frame);
else if (ref_frame_flag == VP8_ALT_FLAG)
vp8_yv12_copy_frame_ptr(sd, &cm->alt_ref_frame);
else
return -1;
return 0;
}
int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, char *source, INT64 time_stamp)
{
VP8D_COMP *pbi = (VP8D_COMP *) ptr;
VP8_COMMON *cm = &pbi->common;
int retcode = 0;
struct vpx_usec_timer timer;
(void) size;
// if(pbi->ready_for_new_data == 0)
// return -1;
vpx_usec_timer_start(&timer);
if (ptr == 0)