mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 08:12:44 +00:00
simplify 4-point transform part a bit
Originally committed as revision 11559 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
f3647f59f1
commit
d1cc6e46f2
@ -194,15 +194,13 @@ static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block)
|
|||||||
for(i = 0; i < 8; i++){
|
for(i = 0; i < 8; i++){
|
||||||
t1 = 17 * (src[ 0] + src[16]) + 64;
|
t1 = 17 * (src[ 0] + src[16]) + 64;
|
||||||
t2 = 17 * (src[ 0] - src[16]) + 64;
|
t2 = 17 * (src[ 0] - src[16]) + 64;
|
||||||
t3 = 22 * src[ 8];
|
t3 = 22 * src[ 8] + 10 * src[24];
|
||||||
t4 = 22 * src[24];
|
t4 = 22 * src[24] - 10 * src[ 8];
|
||||||
t5 = 10 * src[ 8];
|
|
||||||
t6 = 10 * src[24];
|
|
||||||
|
|
||||||
dest[0*linesize] = cm[dest[0*linesize] + ((t1 + t3 + t6) >> 7)];
|
dest[0*linesize] = cm[dest[0*linesize] + ((t1 + t3) >> 7)];
|
||||||
dest[1*linesize] = cm[dest[1*linesize] + ((t2 - t4 + t5) >> 7)];
|
dest[1*linesize] = cm[dest[1*linesize] + ((t2 - t4) >> 7)];
|
||||||
dest[2*linesize] = cm[dest[2*linesize] + ((t2 + t4 - t5) >> 7)];
|
dest[2*linesize] = cm[dest[2*linesize] + ((t2 + t4) >> 7)];
|
||||||
dest[3*linesize] = cm[dest[3*linesize] + ((t1 - t3 - t6) >> 7)];
|
dest[3*linesize] = cm[dest[3*linesize] + ((t1 - t3) >> 7)];
|
||||||
|
|
||||||
src ++;
|
src ++;
|
||||||
dest++;
|
dest++;
|
||||||
@ -223,15 +221,13 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block)
|
|||||||
for(i = 0; i < 8; i++){
|
for(i = 0; i < 8; i++){
|
||||||
t1 = 17 * (src[0] + src[2]) + 4;
|
t1 = 17 * (src[0] + src[2]) + 4;
|
||||||
t2 = 17 * (src[0] - src[2]) + 4;
|
t2 = 17 * (src[0] - src[2]) + 4;
|
||||||
t3 = 22 * src[1];
|
t3 = 22 * src[1] + 10 * src[3];
|
||||||
t4 = 22 * src[3];
|
t4 = 22 * src[3] - 10 * src[1];
|
||||||
t5 = 10 * src[1];
|
|
||||||
t6 = 10 * src[3];
|
|
||||||
|
|
||||||
dst[0] = (t1 + t3 + t6) >> 3;
|
dst[0] = (t1 + t3) >> 3;
|
||||||
dst[1] = (t2 - t4 + t5) >> 3;
|
dst[1] = (t2 - t4) >> 3;
|
||||||
dst[2] = (t2 + t4 - t5) >> 3;
|
dst[2] = (t2 + t4) >> 3;
|
||||||
dst[3] = (t1 - t3 - t6) >> 3;
|
dst[3] = (t1 - t3) >> 3;
|
||||||
|
|
||||||
src += 8;
|
src += 8;
|
||||||
dst += 8;
|
dst += 8;
|
||||||
@ -273,7 +269,7 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block)
|
|||||||
static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block)
|
static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
register int t1,t2,t3,t4,t5,t6;
|
register int t1,t2,t3,t4;
|
||||||
DCTELEM *src, *dst;
|
DCTELEM *src, *dst;
|
||||||
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
|
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
|
||||||
|
|
||||||
@ -282,15 +278,13 @@ static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block)
|
|||||||
for(i = 0; i < 4; i++){
|
for(i = 0; i < 4; i++){
|
||||||
t1 = 17 * (src[0] + src[2]) + 4;
|
t1 = 17 * (src[0] + src[2]) + 4;
|
||||||
t2 = 17 * (src[0] - src[2]) + 4;
|
t2 = 17 * (src[0] - src[2]) + 4;
|
||||||
t3 = 22 * src[1];
|
t3 = 22 * src[1] + 10 * src[3];
|
||||||
t4 = 22 * src[3];
|
t4 = 22 * src[3] - 10 * src[1];
|
||||||
t5 = 10 * src[1];
|
|
||||||
t6 = 10 * src[3];
|
|
||||||
|
|
||||||
dst[0] = (t1 + t3 + t6) >> 3;
|
dst[0] = (t1 + t3) >> 3;
|
||||||
dst[1] = (t2 - t4 + t5) >> 3;
|
dst[1] = (t2 - t4) >> 3;
|
||||||
dst[2] = (t2 + t4 - t5) >> 3;
|
dst[2] = (t2 + t4) >> 3;
|
||||||
dst[3] = (t1 - t3 - t6) >> 3;
|
dst[3] = (t1 - t3) >> 3;
|
||||||
|
|
||||||
src += 8;
|
src += 8;
|
||||||
dst += 8;
|
dst += 8;
|
||||||
@ -300,15 +294,13 @@ static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block)
|
|||||||
for(i = 0; i < 4; i++){
|
for(i = 0; i < 4; i++){
|
||||||
t1 = 17 * (src[ 0] + src[16]) + 64;
|
t1 = 17 * (src[ 0] + src[16]) + 64;
|
||||||
t2 = 17 * (src[ 0] - src[16]) + 64;
|
t2 = 17 * (src[ 0] - src[16]) + 64;
|
||||||
t3 = 22 * src[ 8];
|
t3 = 22 * src[ 8] + 10 * src[24];
|
||||||
t4 = 22 * src[24];
|
t4 = 22 * src[24] - 10 * src[ 8];
|
||||||
t5 = 10 * src[ 8];
|
|
||||||
t6 = 10 * src[24];
|
|
||||||
|
|
||||||
dest[0*linesize] = cm[dest[0*linesize] + ((t1 + t3 + t6) >> 7)];
|
dest[0*linesize] = cm[dest[0*linesize] + ((t1 + t3) >> 7)];
|
||||||
dest[1*linesize] = cm[dest[1*linesize] + ((t2 - t4 + t5) >> 7)];
|
dest[1*linesize] = cm[dest[1*linesize] + ((t2 - t4) >> 7)];
|
||||||
dest[2*linesize] = cm[dest[2*linesize] + ((t2 + t4 - t5) >> 7)];
|
dest[2*linesize] = cm[dest[2*linesize] + ((t2 + t4) >> 7)];
|
||||||
dest[3*linesize] = cm[dest[3*linesize] + ((t1 - t3 - t6) >> 7)];
|
dest[3*linesize] = cm[dest[3*linesize] + ((t1 - t3) >> 7)];
|
||||||
|
|
||||||
src ++;
|
src ++;
|
||||||
dest++;
|
dest++;
|
||||||
|
Loading…
Reference in New Issue
Block a user