📄 full_search_mpeg2.asm
字号:
P0 = R6;
R6 = B3;
R6 = R6 + R7;
P1 = R6;
B[P0++] = R0; // Store motion vector along Y direction
R3 = 16;
P4 = B3;
B[P1++] = R1; // Store motion vector along X direction
/***************************** NORTH *****************************************
The motion vectors for the macro blocks in the first row, except the first and
last ones are computed by this code segment. The motion vector along the
vertical direction is non-negative and in the horizontal direction it can be any
integer within the allowed search range which is decided by the
search_area_factor.
*******************************************************************************/
P4 += 1; // Address calculation for storing the X motion
// vector
P5 = B2;
P5 += 1; // Address calculation for storing the Y motion
// vector
R0 = B0;
R1 = R0 + R3 (NS) || R6 = [SP + 4];
R0 = B1;
R0 = R0 + R3 (NS) || [SP + 8] = R1;
// Starting address of the target block
R0 = R0 - R6 (NS) || [SP + 12] = R0;
// Location of the target block in the reference
// frame
[SP + 16] = R0; // Starting address of the reference block
R0 = R6 << 1 || R7 = [SP + 32];
[SP + 20] = R0;
[SP + 24] = R6;
R7 += -2;
LOOP1:
CC = R7 <= 0; // Loop for the first row target macro blocks
IF CC JUMP LOOP1_OVER;
R0 = SP;
R1 = P3;
CALL __mve_core; // Finds the best matching macro block and computes
// the motion vectors
R2 = [SP + 8];
R2 += 16;
[SP + 8] = R2;
R2 = [SP + 12];
R2 += 16;
[SP + 12] = R2;
R2 = [SP + 16];
R2 += 16;
[SP + 16] = R2;
B[P5++] = R0; // Store motion vector along Y direction
B[P4++] = R1; // Store motion vector along X direction
R7 += -1;
JUMP LOOP1;
/******************************* SOUTH ****************************************
The motion vectors for the macro blocks in the last row, except the first and
last ones are computed by this code segment. The motion vector along the
vertical direction is negative or zero and in the horizontal direction it can be
any integer within the allowed search range which is decided by the
search_area_factor.
*******************************************************************************/
LOOP1_OVER:
R0 = [SP + 40];
R0 += -1;
R1 = [SP + 32];
R1 = R1.L*R0.L (IS);
R1 += 1;
R0 = B2;
R0 = R0 + R1; // Address calculation for storing the Y motion
// vector
P5 = R0;
R0 = B3;
R0 = R0 + R1 (NS) || R1 = [SP + 36];
// Address calculation for storing the X motion
// vector
P4 = R0;
R0 = B0;
R1 = R1.L*R5.L (IS) || R6 = [SP + 4];
R1 += 16;
R2 = R0 + R1;
R0 = B1;
R0 = R0 + R1 (NS) || [SP + 8] = R2;
// Starting address of the target block
R0 = R0 - R6 (NS) || [SP + 12] = R0;
// Location of the target block in the reference
// frame
R1 = R6.L*R5.L (IS) || R7 = [SP + 32];
R0 = R0 - R1;
R0 = R6 << 1 || [SP + 16] = R0;
// Starting address of the reference block
[SP + 20 ] = R0;
R6 += 1;
[SP + 24] = R6;
R7 += -2;
LOOP2:
CC = R7 <= 0; // Loop for the last row target macro blocks
IF CC JUMP LOOP2_OVER;
R0 = SP;
R1 = P3;
CALL __mve_core; // Finds the best matching macro block and computes
// the motion vectors
R2 = [SP + 8];
R2 += 16;
[SP + 8] = R2;
R2 = [SP + 12];
R2 += 16;
[SP + 12] = R2;
R2 = [SP + 16];
R2 += 16;
[SP + 16] = R2;
B[P5++] = R0; // Store motion vector along Y direction
B[P4++] = R1; // Store motion vector along X direction
R7 += -1;
JUMP LOOP2;
/************************************ WEST ************************************
The motion vectors for the macro blocks in the first column, except the first
and last ones are computed by this code segment. The motion vector along the
horizontal direction is non-negative and in the vertical direction it can be any
integer within the allowed search range which is decided by the
search_area_factor.
******************************************************************************/
LOOP2_OVER:
R0 = B0;
R1 = R5 << 4 || R6 = [SP + 4];
R2 = R0 + R1 (NS) || [SP + 20] = R6;
R0 = B1;
R0 = R0 + R1 (NS) || [SP + 8] = R2;
// Starting address of the target block
R3 = R6.L*R5.L (IS) || [SP + 12] = R0;
// Location of the target block in the reference
// frame
R6 = R6 << 1 || R1 = [SP + 32];
R2 = R0 - R3 (NS) || [SP + 24] = R6;
R0 = B2;
R0 = R0 + R1 (NS) || [SP + 16] = R2;
// Starting address of the reference block
P5 = R0; // Address calculation for storing the Y motion
// vector
R0 = B3;
R0 = R0 + R1 (NS) || R7 = [SP + 40];
P4 = R0; // Address calculation for storing the X motion
// vector
R7 += -2;
LOOP3:
CC = R7 <= 0; // Loop for the first column target macro blocks
IF CC JUMP LOOP3_OVER;
R0 = SP;
R1 = P3;
CALL __mve_core; // Finds the best matching macro block and computes
// the motion vectors
R3 = [SP + 32];
P0 = R3;
R3 = R5 << 4 || R6 = [SP + 8];
R2 = R6 + R3 (NS) || R6 = [SP + 12];
R2 = R6 + R3 (NS) || [SP + 8] = R2;
R6 = [SP + 16];
R2 = R6 + R3 (NS) || [SP + 12] = R2;
[SP + 16] = R2;
B[P5] = R0; // Store motion vector along Y direction
B[P4] = R1; // Store motion vector along X direction
P5 = P5 + P0;
P4 = P4 + P0;
R7 += -1;
JUMP LOOP3;
/*************************** EAST *********************************************
The motion vectors for the macro blocks in the last column, except the first and
last ones are computed by this code segment. The motion vector along the
horizontal direction is negative or zero and in the vertical direction it can be
any integer within the allowed search range which is decided by the
search_area_factor.
*******************************************************************************/
LOOP3_OVER:
R0 = B0;
R1 = R5 << 4 || R2 = [SP + 28];
R1 = R1 + R2 (NS) || R6 = [SP + 4];
R6 += 1;
R2 = R0 + R1 (NS) || [SP + 20] = R6;
R6 += -1;
R0 = B1;
R0 = R0 + R1 (NS) || [SP + 8] = R2;
// Starting address of the target block
R3 = R6.L*R5.L (IS) || [SP + 12] = R0;
// Location of the target block in the reference
// frame
R3 = R3 + R6 (NS);
R6 = R6 << 1 || R1 = [SP + 32];
R2 = R0 - R3 (NS) || [SP + 24] = R6;
R0 = B2;
R1 <<= 1;
R1 += -1;
R0 = R0 + R1 (NS) || [SP + 16] = R2;
// Starting address of the reference block
P5 = R0; // Address calculation for storing the Y motion
// vector
R0 = B3;
R0 = R0 + R1 (NS) || R7 = [SP + 40];
P4 = R0; // Address calculation for storing the X motion
// vector
R7 += -2;
LOOP4:
CC = R7 <= 0; // Loop for the last column target macro blocks
IF CC JUMP LOOP4_OVER;
R0 = SP;
R1 = P3;
CALL __mve_core; // Finds the best matching macro block and computes
// the motion vectors
R3 = [SP + 32];
P0 = R3;
R3 = R5 << 4 || R6 = [SP + 8];
R2 = R6 + R3 (NS) || R6 = [SP + 12];
R2 = R6 + R3 (NS) || [SP + 8] = R2;
R6 = [SP + 16];
R2 = R6 + R3 (NS) || [SP + 12] = R2;
[SP + 16] = R2;
B[P5] = R0; // Store motion vector along Y direction
B[P4] = R1; // Store motion vector along X direction
P5 = P5 + P0;
P4 = P4 + P0;
R7 += -1;
JUMP LOOP4;
/******************************** CENTRAL *************************************
The motion vectors for the macro blocks, other than those in the boundary of the
frame are computed by this code segment. The motion vector along the horizontal
and verical directions can be any integer within the allowed search range which
is decided by the search_area_factor.
*******************************************************************************/
LOOP4_OVER:
R0 = B0;
R1 = R5 << 4 || R6 = [SP + 4];
R1 += 16;
R2 = R0 + R1 (NS) || R4 = [SP + 40];
R0 = B1;
R0 = R0 + R1 (NS) || [SP + 8] = R2;
// Starting address of the target block
R3 = R6.L*R5.L (IS) || [SP + 12] = R0;
// Location of the target block in the reference
// frame
R3 = R3 + R6 (NS);
R6 = R6 << 1 || R1 = [SP + 32];
R2 = R0 - R3 (NS) || [SP + 24] = R6;
R0 = B2;
R1 += 1;
R0 = R0 + R1 (NS) || [SP + 16] = R2;
// Starting address of the reference block
P5 = R0; // Address calculation for storing the Y motion
// vector
R0 = B3;
R0 = R0 + R1 (NS) || [SP + 20] = R6;
P4 = R0; // Address calculation for storing the X motion
// vector
R4 += -2;
NEXT:
CC = R4 <= 0; // Loop for the central target macro blocks
IF CC JUMP LOOP5_OVER;
R7 = [SP + 32];
R7 += -2;
LOOP5:
CC = R7 <= 0;
IF CC JUMP ROW_OVER;
R0 = SP;
R1 = P3;
CALL __mve_core; // Finds the best matching macro block and computes
// the motion vectors
R0 = R0 - R0 (NS) || [P3 + 32] = R5;
[P3 + 24] = R0;
[P3 + 28] = R0;
R0 = [SP + 8];
R1 = [SP + 4];
R1 = R1 << 1 || [P3 + 36] = R0;
[P3 + 40] = R1;
R0 = P3;
CALL _hpel; // Call the half-pixelation routine to give a half-
// pixel correction to the integer MVs
R2 = [SP + 8];
R2 += 16;
[SP + 8] = R2;
R2 = [SP + 12];
R2 += 16;
[SP + 12] = R2;
R2 = [SP + 16];
R2 += 16;
[SP + 16] = R2;
B[P5++] = R0; // Store motion vector along Y direction
B[P4++] = R1 || NOP; // Store motion vector along X direction
R7 += -1;
JUMP LOOP5;
ROW_OVER:
R3 = R5 << 4 || R0 = [SP + 28];
R2 = R3 - R0 (NS) || R6 = [SP + 8];
R2 += 16;
R6 = R6 + R2 (NS) || R0 = [SP + 12];
R0 = R0 + R2 (NS) || [SP + 8] = R6;
R3 = [SP + 16];
R3 = R3 + R2 (NS) || [SP + 12] = R0;
[SP + 16] = R3;
P5 += 2;
P4 += 2;
R4 += -1;
JUMP NEXT;
LOOP5_OVER:
SP += 52;
SP += 52;
(R7:4, P5:3) = [SP++];
RETS = [SP++];
RTS;
NOP;
__full_search_mpeg2.end:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -