comparison libpostproc/postprocess.c @ 1075:7f5587a7dd10 libavcodec

sync with mplayerxp. Fixes some 405.avi related flaws
author nickols_k
date Thu, 20 Feb 2003 16:14:12 +0000
parents 0a48dd404167
children 65908e4b81f8
comparison
equal deleted inserted replaced
1074:d90c350454da 1075:7f5587a7dd10
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;
803 PPMode *mode = (PPMode*)vm; 804 PPMode *mode = (PPMode*)vm;
804 PPContext *c = (PPContext*)vc; 805 PPContext *c = (PPContext*)vc;
805 int minStride= MAX(srcStride[0], dstStride[0]); 806 int minStride= MAX(srcStride[0], dstStride[0]);
806 807
807 if(c->stride < minStride) 808 if(c->stride < minStride)
845 if(verbose>2) 846 if(verbose>2)
846 { 847 {
847 printf("using npp filters 0x%X/0x%X\n", mode->lumMode, mode->chromMode); 848 printf("using npp filters 0x%X/0x%X\n", mode->lumMode, mode->chromMode);
848 } 849 }
849 850
851 /* special case for 405.avi: (width=356)%8 !=0 */
852 horz_size = (width / BLOCK_SIZE) * BLOCK_SIZE;
853
850 postProcess(src[0], srcStride[0], dst[0], dstStride[0], 854 postProcess(src[0], srcStride[0], dst[0], dstStride[0],
851 width, height, QP_store, QPStride, 0, mode, c); 855 horz_size, 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 }
852 864
853 width = (width )>>c->hChromaSubSample; 865 width = (width )>>c->hChromaSubSample;
866 horz_size = (width / BLOCK_SIZE) * BLOCK_SIZE;
854 height = (height)>>c->vChromaSubSample; 867 height = (height)>>c->vChromaSubSample;
855 868
856 if(mode->chromMode) 869 if(mode->chromMode)
857 { 870 {
858 postProcess(src[1], srcStride[1], dst[1], dstStride[1], 871 postProcess(src[1], srcStride[1], dst[1], dstStride[1],
859 width, height, QP_store, QPStride, 1, mode, c); 872 horz_size, height, QP_store, QPStride, 1, mode, c);
860 postProcess(src[2], srcStride[2], dst[2], dstStride[2], 873 postProcess(src[2], srcStride[2], dst[2], dstStride[2],
861 width, height, QP_store, QPStride, 2, mode, c); 874 horz_size, 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 }
862 } 885 }
863 else if(srcStride[1] == dstStride[1] && srcStride[2] == dstStride[2]) 886 else if(srcStride[1] == dstStride[1] && srcStride[2] == dstStride[2])
864 { 887 {
865 memcpy(dst[1], src[1], srcStride[1]*height); 888 memcpy(dst[1], src[1], srcStride[1]*height);
866 memcpy(dst[2], src[2], srcStride[2]*height); 889 memcpy(dst[2], src[2], srcStride[2]*height);