?? jpeg_formmcu_blackfin.asm
字號(hào):
/*****************************************************************************
Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved. This software is
proprietary and confidential to Analog Devices, Inc. and its licensors.
******************************************************************************
$RCSfile: JPEG_FormMCU_BLACKFIN.asm,v $
$Revision: 1.1 $
$Date: 2006/07/17 07:44:02 $
Project: JPEG IMAGE CODEC
Title: Formation of the Image MCU
Author(s): M.
Revised by:
Description : Formation of the code unit
References:
******************************************************************************
Tab Setting: 4
Target Processor: Blackfin
Target Tools Revision: VDSP++ 4.0
******************************************************************************
Modification History:
====================
$Log: JPEG_FormMCU_BLACKFIN.asm,v $
Revision 1.1 2006/07/17 07:44:02 bmk
JPEG-MJPEG User access files
******************************************************************************/
#include "si_errata.h"
/*
*******************************************************************************
Name : gFormMCU420JpegEnc_BLACKFIN(tMcuJpegEnc *mbdata,uint8 *mcuData)
Description : MacroBlock Formation for YUV 420 Image data mode.
Parameter : Pointer to the Jpeg encoder Mcu data sttucture,and Pointer
to the mcuData buffer.
Return Value : None
*******************************************************************************
*/
#define LumCurrpos 16
#define FrameWidth 8
.section JPEG_P0;
.global _gFormMCU420JpegEnc_BLACKFIN;
.align 8;
_gFormMCU420JpegEnc_BLACKFIN:
P0 = R0; // P0 = Pointer to the mcu stucture
P1 = R1; //I1 = Pointer to the mcuData Buffer
P2 = 8;
NOP; NOP;
R2 = [P0 + FrameWidth];// R2 = FrameWidth
R3 = [P0 + LumCurrpos]; // R3 = LumCurrPos
I0 = R3;
R2 += -4;
M0 = R2;
R3 += 8;
I1 = R3;
R3 += -8;
R2 = [P0 + FrameWidth];/*enc->totalLumFrW*/
R2 <<= 3;
R3 = R3 + R2;
I2 = R3;
R3 += 8;
I3 = R3;
/*block 1*/
LOOP lCount_sFormMCU420_BLACKFIN_1 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU420_BLACKFIN_1;
R0 = [I0++];
[P1++] = R0 || R1 = [I0++M0];
WORKAROUND_05000174
[P1++] = R1;
LOOP_END lCount_sFormMCU420_BLACKFIN_1;
/*block 2*/
LOOP lCount_sFormMCU420_BLACKFIN_2 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU420_BLACKFIN_2;
R0 = [I1++];
[P1++] = R0 || R1 = [I1++M0];
WORKAROUND_05000174
[P1++] = R1;
LOOP_END lCount_sFormMCU420_BLACKFIN_2;
/*block 3*/
LOOP lCount_sFormMCU420_BLACKFIN_3 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU420_BLACKFIN_3;
R0 = [I2++];
[P1++] = R0 || R1 = [I2++M0];
WORKAROUND_05000174
[P1++] = R1;
LOOP_END lCount_sFormMCU420_BLACKFIN_3;
/*block 4*/
LOOP lCount_sFormMCU420_BLACKFIN_4 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU420_BLACKFIN_4;
R0 = [I3++];
[P1++] = R0 || R1 = [I3++M0];
WORKAROUND_05000174
[P1++] = R1;
LOOP_END lCount_sFormMCU420_BLACKFIN_4;
/*Cb*/
R3 = [P0 + LumCurrpos + 4];/*mbdata->CbCurrPos*/
I0 = R3;
R2 = [P0 + FrameWidth]; /*enc->totalCbFrW*/
R2 = R2 >> 1;
R2 += -4;
M1 = R2;
R3 = [P0 + LumCurrpos + 8]; /*mbdata->CbCurrPos*/
I1 = R3;
LOOP lCount_sFormMCU420_BLACKFIN_5 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU420_BLACKFIN_5;
R0 = [I0++];
[P1++] = R0 || R1 = [I0++M1];
WORKAROUND_05000174
[P1++] = R1;
LOOP_END lCount_sFormMCU420_BLACKFIN_5;
/*Cr*/
LOOP lCount_sFormMCU420_BLACKFIN_6 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU420_BLACKFIN_6;
R0 = [I1++];
[P1++] = R0 || R1 = [I1++M1];
WORKAROUND_05000174
[P1++] = R1;
LOOP_END lCount_sFormMCU420_BLACKFIN_6;
RTS;
_gFormMCU420JpegEnc_BLACKFIN.end:
/*
*******************************************************************************
Name : gFormMCU422JpegEnc_BLACKFIN(tMcuJpegEnc *mbdata,uint8 *mcuData)
Description : MacroBlock Formation for YUV 420 Image data mode.
Parameter : Pointer to the Jpeg encoder Mcu data sttucture,and Pointer
to the mcuData buffer.
Return Value : None
*******************************************************************************
*/
.section JPEG_P0;
.global _gFormMCU422JpegEnc_BLACKFIN;
.align 8;
_gFormMCU422JpegEnc_BLACKFIN:
P0 = R0; // P0 = Pointer to the mcu stucture
P1 = R1; //I1 = Pointer to the mcuData Buffer
P2 = 8;
NOP; NOP;
R2 = [P0 + FrameWidth];// R2 = FrameWidth
R3 = [P0 + LumCurrpos]; // R3 = LumCurrPos
I0 = R3;
R2 += -4;
M0 = R2;
R3 += 8;
I1 = R3;
/*block 1*/
LOOP lCount_sFormMCU422_BLACKFIN_1 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU422_BLACKFIN_1;
R0 = [I0++];
[P1++] = R0 || R1 = [I0++M0];
WORKAROUND_05000174
[P1++] = R1;
LOOP_END lCount_sFormMCU422_BLACKFIN_1;
/*block 2*/
LOOP lCount_sFormMCU422_BLACKFIN_2 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU422_BLACKFIN_2;
R0 = [I1++];
[P1++] = R0 || R1 = [I1++M0];
WORKAROUND_05000174
[P1++] = R1;
LOOP_END lCount_sFormMCU422_BLACKFIN_2;
/*Cb*/
R3 = [P0 + LumCurrpos + 4]; /*mbdata->CbCurrPos*/
I2 = R3;
R2 = [P0 + FrameWidth]; /*enc->totalCbFrW*/
R2 = R2 >> 1;
R2 += -4;
M1 = R2;
R3 = [P0 + LumCurrpos + 8]; /*mbdata->CbCurrPos*/
I3 = R3;
LOOP lCount_sFormMCU422_BLACKFIN_5 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU422_BLACKFIN_5;
R0 = [I2++];
[P1++] = R0 || R1 = [I2++M1];
WORKAROUND_05000174
[P1++] = R1;
LOOP_END lCount_sFormMCU422_BLACKFIN_5;
/*Cr*/
LOOP lCount_sFormMCU422_BLACKFIN_6 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU422_BLACKFIN_6;
R0 = [I3++];
[P1++] = R0 || R1 = [I3++M1];
WORKAROUND_05000174
[P1++] = R1;
LOOP_END lCount_sFormMCU422_BLACKFIN_6;
RTS;
_gFormMCU422JpegEnc_BLACKFIN.end:
/*
*******************************************************************************
Name : gFormMCU444JpegEnc_BLACKFIN(tMcuJpegEnc *mbdata,uint8 *mcuData)
Description : MacroBlock Formation for YUV 420 Image data mode.
Parameter : Pointer to the Jpeg encoder Mcu data sttucture,and Pointer
to the mcuData buffer.
Return Value : None
*******************************************************************************
*/
.section JPEG_P0;
.global _gFormMCU444JpegEnc_BLACKFIN;
.align 8;
_gFormMCU444JpegEnc_BLACKFIN:
P0 = R0; // P0 = Pointer to the mcu stucture
I1 = R1; //I1 = Pointer to the mcuData Buffer
P2 = 8;
NOP; NOP;
R2 = [P0 + FrameWidth];// R2 = FrameWidth
R3 = [P0 + LumCurrpos]; // R3 = LumCurrPos
I0 = R3;
R2 += -4;
M0 = R2;
R3 = [P0 + LumCurrpos + 4];/*mbdata->CbCurrPos*/
I2 = R3;
R3 = [P0 + LumCurrpos + 8]; /*mbdata->CbCurrPos*/
I3 = R3;
/*block 1*/
LOOP lCount_sFormMCU444_BLACKFIN_1 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU444_BLACKFIN_1;
R0 = [I0++];
[I1++] = R0 || R1 = [I0++M0];
WORKAROUND_05000174
[I1++] = R1;
LOOP_END lCount_sFormMCU444_BLACKFIN_1;
/*Cb*/
LOOP lCount_sFormMCU444_BLACKFIN_5 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU444_BLACKFIN_5;
R0 = [I2++];
[I1++] = R0 || R1 = [I2++M0];
WORKAROUND_05000174
[I1++] = R1;
LOOP_END lCount_sFormMCU444_BLACKFIN_5;
/*Cr*/
LOOP lCount_sFormMCU444_BLACKFIN_6 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU444_BLACKFIN_6;
R0 = [I3++];
[I1++] = R0 || R1 = [I3++M0];
WORKAROUND_05000174
[I1++] = R1;
LOOP_END lCount_sFormMCU444_BLACKFIN_6;
RTS;
_gFormMCU444JpegEnc_BLACKFIN.end:
/*
*******************************************************************************
Name : gFormMCU400JpegEnc_BLACKFIN(tMcuJpegEnc *mbdata,uint8 *mcuData)
Description : MacroBlock Formation for YUV 420 Image data mode.
Parameter : Pointer to the Jpeg encoder Mcu data sttucture,and Pointer
to the mcuData buffer.
Return Value : None
*******************************************************************************
*/
.section JPEG_P0;
.global _gFormMCU400JpegEnc_BLACKFIN;
.align 8;
_gFormMCU400JpegEnc_BLACKFIN:
P0 = R0; // P0 = Pointer to the mcu stucture
I1 = R1; //I1 = Pointer to the mcuData Buffer
P2 = 8;
NOP; NOP;
R3 = [P0 + LumCurrpos]; // R3 = LumCurrPos
I0 = R3;
R2 = [P0 + FrameWidth];// R2 = FrameWidth
R2 += -4;
M0 = R2;
LOOP lCount_sFormMCU400_BLACKFIN_1 LC0 = P2;
LOOP_BEGIN lCount_sFormMCU400_BLACKFIN_1;
R0 = [I0++];
[I1++] = R0 || R1 = [I0++M0];
WORKAROUND_05000174
[I1++] = R1;
LOOP_END lCount_sFormMCU400_BLACKFIN_1;
RTS;
_gFormMCU400JpegEnc_BLACKFIN.end:
/*
*******************************************************************************
Name : gFormRowLosslessJpegEnc_BLACKFIN(tMcuJpegEnc *mcuHandle, uint8 *mcuData)
Description : Copies the one row of data into mcuData buffer.
Parameter :Pointer to the mcu structure, pointer to the mcudata buffer.
Return Value : None
*******************************************************************************
*/
.section JPEG_P0;
.global _gFormRowLosslessJpegEnc_BLACKFIN;
.align 8;
_gFormRowLosslessJpegEnc_BLACKFIN:
P0 = R0; // P0 = Pointer to the mcu stucture
NOP; NOP; NOP; NOP;
P2 = [P0 + FrameWidth];// P2 = FrameWidth
P1 = [P0 + LumCurrpos]; // P1 = LumCurrPos
P0 = R1; // P0 = Pointer to the mcuData
NOP; NOP;
LOOP lCount_gFormRowLosslessJpegEnc_BLACKFIN_1 LC0 = P2 ;
LOOP_BEGIN lCount_gFormRowLosslessJpegEnc_BLACKFIN_1;
R0 = B[P1++] (Z);
B[P0++] = R0 ;
LOOP_END lCount_gFormRowLosslessJpegEnc_BLACKFIN_1;
RTS;
_gFormRowLosslessJpegEnc_BLACKFIN.end:
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -