MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / w_c

Function w_c

libavcodec/dwt.c:735–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

733}
734
735static inline int w_c(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int w, int h, int type){
736 int s, i, j;
737 const int dec_count= w==8 ? 3 : 4;
738 int tmp[32*32];
739 int level, ori;
740 static const int scale[2][2][4][4]={
741 {
742 {
743 // 9/7 8x8 dec=3
744 {268, 239, 239, 213},
745 { 0, 224, 224, 152},
746 { 0, 135, 135, 110},
747 },{
748 // 9/7 16x16 or 32x32 dec=4
749 {344, 310, 310, 280},
750 { 0, 320, 320, 228},
751 { 0, 175, 175, 136},
752 { 0, 129, 129, 102},
753 }
754 },{
755 {
756 // 5/3 8x8 dec=3
757 {275, 245, 245, 218},
758 { 0, 230, 230, 156},
759 { 0, 138, 138, 113},
760 },{
761 // 5/3 16x16 or 32x32 dec=4
762 {352, 317, 317, 286},
763 { 0, 328, 328, 233},
764 { 0, 180, 180, 140},
765 { 0, 132, 132, 105},
766 }
767 }
768 };
769
770 for (i = 0; i < h; i++) {
771 for (j = 0; j < w; j+=4) {
772 tmp[32*i+j+0] = (pix1[j+0] - pix2[j+0])<<4;
773 tmp[32*i+j+1] = (pix1[j+1] - pix2[j+1])<<4;
774 tmp[32*i+j+2] = (pix1[j+2] - pix2[j+2])<<4;
775 tmp[32*i+j+3] = (pix1[j+3] - pix2[j+3])<<4;
776 }
777 pix1 += line_size;
778 pix2 += line_size;
779 }
780
781 ff_spatial_dwt(tmp, w, h, 32, type, dec_count);
782
783 s=0;
784 assert(w==h);
785 for(level=0; level<dec_count; level++){
786 for(ori= level ? 1 : 0; ori<4; ori++){
787 int size= w>>(dec_count-level);
788 int sx= (ori&1) ? size : 0;
789 int stride= 32<<(dec_count-level);
790 int sy= (ori&2) ? stride>>1 : 0;
791
792 for(i=0; i<size; i++){

Callers 6

w53_8_cFunction · 0.85
w97_8_cFunction · 0.85
w53_16_cFunction · 0.85
w97_16_cFunction · 0.85
ff_w53_32_cFunction · 0.85
ff_w97_32_cFunction · 0.85

Calls 1

ff_spatial_dwtFunction · 0.85

Tested by

no test coverage detected