📄 mpa_error.s
字号:
/*
* mpa_error.s
*
* MPEG/audio multichannel decoder.
* Copyright (C) 2003 Optical Player P/J, Samsung Electronics.
*/
.include "mpa.h"
.secFILE_mpa_error
/********************************************************************
Function: mpa_error_process
Description:
********************************************************************/
mpa_error_process::
push a14
ld a8, #SFR_BASE
_ERR_CODE_01 cmp eq, r2, #_MPG_SYNC_NOT_FOUND
brf _ERR_CODE_02
/* error porcess */
bra end_error_process
_ERR_CODE_02 cmp eq, r2, #_EXT_SYNC_NOT_FOUND
brf _ERR_CODE_03
bra end_error_process
_ERR_CODE_03 cmp eq, r2, #_BASE_CRC_ERROR
brf _ERR_CODE_04
bra end_error_process
_ERR_CODE_04 cmp eq, r2, #_MC_CRC_ERROR
brf _ERR_CODE_05
bra end_error_process
_ERR_CODE_05 cmp eq, r2, #_AUG_CRC_ERROR
brf _ERR_CODE_06
bra end_error_process
_ERR_CODE_06 cmp eq, r2, #_EXT_CRC_ERROR
brf _ERR_CODE_07
bra end_error_process
_ERR_CODE_07 cmp eq, r2, #_CRC_RECOVERED
brf _ERR_CODE_08
bra end_error_process
_ERR_CODE_08 cmp eq, r2, #_ILLEGAL_LAYER
brf _ERR_CODE_09
bra end_error_process
_ERR_CODE_09 cmp eq, r2, #_ILLEGAL_MTX_MODE
brf _ERR_CODE_10
bra end_error_process
_ERR_CODE_10 cmp eq, r2, #_ILLEGAL_AUG_MTX_MODE
brf _ERR_CODE_11
bra end_error_process
_ERR_CODE_11 cmp eq, r2, #_ILLEGAL_DOWNMIX_MODE
brf _ERR_CODE_12
bra end_error_process
_ERR_CODE_12 cmp eq, r2, #_ILLEGAL_MC_PRED_MODE
brf _ERR_CODE_13
eld a, #_MPEG_1_AUDIO
eld rpd1.mpeg_version, a
eld b, #_MPEG1_STEREO
eld rpd1.channel_config, b
bra end_error_process
_ERR_CODE_13 cmp eq, r2, #_NO_MAIN_AUDIO_DATA
brf _ERR_CODE_14
bra end_error_process
_ERR_CODE_14 cmp eq, r2, #_NO_EXT_AUDIO_DATA
brf _ERR_CODE_15
bra end_error_process
_ERR_CODE_15 cmp eq, r2, #_END_OF_BITSTREAM
brf _ERR_CODE_16
bra end_error_process
_ERR_CODE_16 cmp eq, r2, #_NO_DRC_INFO_IN_STREAM
brf _ERR_CODE_17
ld r0, #FALSE
ldw a9, @[a10+_pParameter]
ldb @[a9+_DRC_Mode], r0
bra skip_mute_frame
_ERR_CODE_17 cmp eq, r2, #_INVALID_DRC_GAIN
brf _ERR_CODE_99
bra skip_mute_frame
_ERR_CODE_18 cmp eq, r2, #_STREAM_IS_BROKEN
brf _ERR_CODE_99
bra end_error_process
_ERR_CODE_99
/* unknown error type */
nop
nop
nop
end_error_process
jsr mute_current_frame
skip_mute_frame
ldb @[a10+_DecodeErrFlag], r2
pop a14
ret
/********************************************************************
Function: mute_current_frame
Description: Clear current output buffer
********************************************************************/
mute_current_frame::
; configuration of SBF1 write mode
ldw r1, @[a8+rCONFIG0]
and r1, #0xf0ff
ldb r0, @[a10+_OutPCMSize]
cmp eq, r0, #PCM_SAMPLE_24BITS
brt _set_s1offset
or r1, #0x0600
_set_s1offset ldw a9, @[a10+_OutputBufferOffset]
ldw @[a8+rCONFIG0], r1
ldw @[a8+rSBL1OFF], a9
eld rp0, #SBF1_PTR
esd0 d0, #0
eld a, #0
.if( OUPUT_2CH == TRUE )
ld r6, #SAMPLES_PER_FRAME*NCH-1
.endif
.if( OUPUT_6CH == TRUE )
ld r6, #SAMPLES_PER_FRAME*(NCH+NMCH+1)-1
.endif
.if( OUPUT_8CH == TRUE )
ld r6, #SAMPLES_PER_FRAME*(NCH+NMCH+DMCH+1)-1
.endif
bnzd r6, $
eld @rp0+d0, a
ret
/* for debuging */
.ifdef _DEBUG_ /* ASM predefined symbol */
.extern |IMAGE$$STACK$$BASE|
print_fraction::
push a14, a10
push a9, a8
push r2
jsr __flush_data
ld a10, #|IMAGE$$STACK$$BASE|+0x1000
eld rp1, #fraction
esd1 s0, #1
ld r6, #GRANULES*MAX_CHANNEL*PARTS*SBLIMIT-1 ; fraction[12][7][3][32]
D_1 eld a, @rp1+s0
ecld r0, a
ecld r1, ah
ldw @[a10+0], r1
ldw @[a10+2], r0
bnzd r6, D_1
add a10, #4
ld a8, #SFR_BASE
ld a9, #0
ld a10, #|IMAGE$$STACK$$BASE|+0x1000
.ifdef _DEBUG_
jsr _print_fraction
.endif
pop r2
pop a8, a9
pop a10, a14
ret
.endif
.end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -