Mercurial > libavcodec.hg
comparison snow.c @ 2592:b70b4b69960b libavcodec
merge vertical lifting steps and a little cleanup
author | michael |
---|---|
date | Mon, 04 Apr 2005 21:35:18 +0000 |
parents | a5a62827f195 |
children | 6b385f3e07a3 |
comparison
equal
deleted
inserted
replaced
2591:65874d96c2da | 2592:b70b4b69960b |
---|---|
1401 for(i=0; i<width; i++){ | 1401 for(i=0; i<width; i++){ |
1402 b1[i] -= (W_DM*(b0[i] + b2[i])+W_DO)>>W_DS; | 1402 b1[i] -= (W_DM*(b0[i] + b2[i])+W_DO)>>W_DS; |
1403 } | 1403 } |
1404 } | 1404 } |
1405 | 1405 |
1406 static void vertical_compose97i(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width){ | |
1407 int i; | |
1408 | |
1409 for(i=0; i<width; i++){ | |
1410 int r; | |
1411 b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS; | |
1412 #ifdef lift5 | |
1413 b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS; | |
1414 #else | |
1415 r= 3*(b2[i] + b4[i]); | |
1416 r+= r>>4; | |
1417 r+= r>>8; | |
1418 b3[i] -= (r+W_CO)>>W_CS; | |
1419 #endif | |
1420 b2[i] += (W_BM*(b1[i] + b3[i])+W_BO)>>W_BS; | |
1421 b1[i] += (W_AM*(b0[i] + b2[i])+W_AO)>>W_AS; | |
1422 } | |
1423 } | |
1424 | |
1406 static void spatial_compose97i_buffered_init(dwt_compose_t *cs, slice_buffer * sb, int height, int stride_line){ | 1425 static void spatial_compose97i_buffered_init(dwt_compose_t *cs, slice_buffer * sb, int height, int stride_line){ |
1407 cs->b0 = slice_buffer_get_line(sb, mirror(-3-1, height-1) * stride_line); | 1426 cs->b0 = slice_buffer_get_line(sb, mirror(-3-1, height-1) * stride_line); |
1408 cs->b1 = slice_buffer_get_line(sb, mirror(-3 , height-1) * stride_line); | 1427 cs->b1 = slice_buffer_get_line(sb, mirror(-3 , height-1) * stride_line); |
1409 cs->b2 = slice_buffer_get_line(sb, mirror(-3+1, height-1) * stride_line); | 1428 cs->b2 = slice_buffer_get_line(sb, mirror(-3+1, height-1) * stride_line); |
1410 cs->b3 = slice_buffer_get_line(sb, mirror(-3+2, height-1) * stride_line); | 1429 cs->b3 = slice_buffer_get_line(sb, mirror(-3+2, height-1) * stride_line); |
1433 DWTELEM *b2= cs->b2; | 1452 DWTELEM *b2= cs->b2; |
1434 DWTELEM *b3= cs->b3; | 1453 DWTELEM *b3= cs->b3; |
1435 DWTELEM *b4= slice_buffer_get_line(sb, mirror4 * stride_line); | 1454 DWTELEM *b4= slice_buffer_get_line(sb, mirror4 * stride_line); |
1436 DWTELEM *b5= slice_buffer_get_line(sb, mirror5 * stride_line); | 1455 DWTELEM *b5= slice_buffer_get_line(sb, mirror5 * stride_line); |
1437 | 1456 |
1438 if(stride_line == 1 && y+4 < height && 0){ | |
1439 int x; | |
1440 for(x=0; x<width/2; x++) | |
1441 b5[x] += 64*2; | |
1442 for(; x<width; x++) | |
1443 b5[x] += 169*2; | |
1444 } | |
1445 | |
1446 // if(mirror3 <= mirror5 && mirror2 <= mirror4 && mirror1 <= mirror3 && mirror0 <= mirror2) | |
1447 // { | |
1448 //{START_TIMER | |
1449 // vertical_compose97_complete(b0, b1, b2, b3, b4, b5, width); | |
1450 //if(width>400){ | |
1451 //STOP_TIMER("vertical_compose97i-NEW")}} | |
1452 // } | |
1453 // else | |
1454 // { | |
1455 {START_TIMER | 1457 {START_TIMER |
1456 if(mirror3 <= mirror5) vertical_compose97iL1(b3, b4, b5, width); | 1458 if(y>0 && y+4<height){ |
1457 if(mirror2 <= mirror4) vertical_compose97iH1(b2, b3, b4, width); | 1459 vertical_compose97i(b0, b1, b2, b3, b4, b5, width); |
1458 if(mirror1 <= mirror3) vertical_compose97iL0(b1, b2, b3, width); | 1460 }else{ |
1459 if(mirror0 <= mirror2) vertical_compose97iH0(b0, b1, b2, width); | 1461 if(mirror3 <= mirror5) vertical_compose97iL1(b3, b4, b5, width); |
1462 if(mirror2 <= mirror4) vertical_compose97iH1(b2, b3, b4, width); | |
1463 if(mirror1 <= mirror3) vertical_compose97iL0(b1, b2, b3, width); | |
1464 if(mirror0 <= mirror2) vertical_compose97iH0(b0, b1, b2, width); | |
1465 } | |
1460 if(width>400){ | 1466 if(width>400){ |
1461 STOP_TIMER("vertical_compose97i")}} | 1467 STOP_TIMER("vertical_compose97i")}} |
1462 // } | |
1463 | 1468 |
1464 {START_TIMER | 1469 {START_TIMER |
1465 if(y-1>= 0) horizontal_compose97i(b0, width); | 1470 if(y-1>= 0) horizontal_compose97i(b0, width); |
1466 if(mirror0 <= mirror2) horizontal_compose97i(b1, width); | 1471 if(mirror0 <= mirror2) horizontal_compose97i(b1, width); |
1467 if(width>400 && mirror0 <= mirror2){ | 1472 if(width>400 && mirror0 <= mirror2){ |