comparison libpostproc/postprocess.c @ 1076:65908e4b81f8 libavcodec

reverse incorrect stride < (width+7)&~7 fix
author michaelni
date Thu, 20 Feb 2003 17:30:51 +0000
parents 7f5587a7dd10
children 3644e555a20a
comparison
equal deleted inserted replaced
1075:7f5587a7dd10 1076:65908e4b81f8
798 QP_STORE_T *QP_store, int QPStride, 798 QP_STORE_T *QP_store, int QPStride,
799 pp_mode_t *vm, void *vc, int pict_type) 799 pp_mode_t *vm, void *vc, int pict_type)
800 { 800 {
801 int mbWidth = (width+15)>>4; 801 int mbWidth = (width+15)>>4;
802 int mbHeight= (height+15)>>4; 802 int mbHeight= (height+15)>>4;
803 int horz_size,vert_size;
804 PPMode *mode = (PPMode*)vm; 803 PPMode *mode = (PPMode*)vm;
805 PPContext *c = (PPContext*)vc; 804 PPContext *c = (PPContext*)vc;
806 int minStride= MAX(srcStride[0], dstStride[0]); 805 int minStride= MAX(srcStride[0], dstStride[0]);
807 806
808 if(c->stride < minStride) 807 if(c->stride < minStride)
846 if(verbose>2) 845 if(verbose>2)
847 { 846 {
848 printf("using npp filters 0x%X/0x%X\n", mode->lumMode, mode->chromMode); 847 printf("using npp filters 0x%X/0x%X\n", mode->lumMode, mode->chromMode);
849 } 848 }
850 849
851 /* special case for 405.avi: (width=356)%8 !=0 */
852 horz_size = (width / BLOCK_SIZE) * BLOCK_SIZE;
853
854 postProcess(src[0], srcStride[0], dst[0], dstStride[0], 850 postProcess(src[0], srcStride[0], dst[0], dstStride[0],
855 horz_size, height, QP_store, QPStride, 0, mode, c); 851 width, height, QP_store, QPStride, 0, mode, c);
856
857 if(horz_size < width)
858 {
859 unsigned y,tail;
860 tail = width-horz_size;
861 for(y=0; y<height; y++)
862 memcpy(&(dst[0][y*dstStride[0]+horz_size]), &(src[0][y*srcStride[0]+horz_size]), tail);
863 }
864 852
865 width = (width )>>c->hChromaSubSample; 853 width = (width )>>c->hChromaSubSample;
866 horz_size = (width / BLOCK_SIZE) * BLOCK_SIZE;
867 height = (height)>>c->vChromaSubSample; 854 height = (height)>>c->vChromaSubSample;
868 855
869 if(mode->chromMode) 856 if(mode->chromMode)
870 { 857 {
871 postProcess(src[1], srcStride[1], dst[1], dstStride[1], 858 postProcess(src[1], srcStride[1], dst[1], dstStride[1],
872 horz_size, height, QP_store, QPStride, 1, mode, c); 859 width, height, QP_store, QPStride, 1, mode, c);
873 postProcess(src[2], srcStride[2], dst[2], dstStride[2], 860 postProcess(src[2], srcStride[2], dst[2], dstStride[2],
874 horz_size, height, QP_store, QPStride, 2, mode, c); 861 width, height, QP_store, QPStride, 2, mode, c);
875 if(horz_size < width)
876 {
877 unsigned y,tail;
878 tail = width-horz_size;
879 for(y=0; y<height; y++)
880 {
881 memcpy(&(dst[1][y*dstStride[1]+horz_size]), &(src[1][y*srcStride[1]+horz_size]), tail);
882 memcpy(&(dst[2][y*dstStride[2]+horz_size]), &(src[2][y*srcStride[2]+horz_size]), tail);
883 }
884 }
885 } 862 }
886 else if(srcStride[1] == dstStride[1] && srcStride[2] == dstStride[2]) 863 else if(srcStride[1] == dstStride[1] && srcStride[2] == dstStride[2])
887 { 864 {
888 memcpy(dst[1], src[1], srcStride[1]*height); 865 memcpy(dst[1], src[1], srcStride[1]*height);
889 memcpy(dst[2], src[2], srcStride[2]*height); 866 memcpy(dst[2], src[2], srcStride[2]*height);