comparison vc1.c @ 3656:1cc5bdadd487 libavcodec

New qpel MC functions conforming to VC-1 standard. Existing DSPUtil functions cause chroma artifacts on some files.
author kostya
date Thu, 31 Aug 2006 04:44:54 +0000
parents 8dbf728f3967
children de842f000384
comparison
equal deleted inserted replaced
3655:8dbf728f3967 3656:1cc5bdadd487
877 } 877 }
878 878
879 if(s->flags & CODEC_FLAG_GRAY) return; 879 if(s->flags & CODEC_FLAG_GRAY) return;
880 /* Chroma MC always uses qpel bilinear */ 880 /* Chroma MC always uses qpel bilinear */
881 uvdxy = ((uvmy & 3) << 2) | (uvmx & 3); 881 uvdxy = ((uvmy & 3) << 2) | (uvmx & 3);
882 if(!v->rnd){ 882 dsp->put_vc1_qpel_pixels_tab[uvdxy](s->dest[1], srcU, s->uvlinesize, v->rnd);
883 dsp->put_qpel_pixels_tab[1][uvdxy](s->dest[1], srcU, s->uvlinesize); 883 dsp->put_vc1_qpel_pixels_tab[uvdxy](s->dest[2], srcV, s->uvlinesize, v->rnd);
884 dsp->put_qpel_pixels_tab[1][uvdxy](s->dest[2], srcV, s->uvlinesize);
885 }else{
886 dsp->put_no_rnd_qpel_pixels_tab[1][uvdxy](s->dest[1], srcU, s->uvlinesize);
887 dsp->put_no_rnd_qpel_pixels_tab[1][uvdxy](s->dest[2], srcV, s->uvlinesize);
888 }
889 } 884 }
890 885
891 /** Do motion compensation for 4-MV macroblock - luminance block 886 /** Do motion compensation for 4-MV macroblock - luminance block
892 */ 887 */
893 static void vc1_mc_4mv_luma(VC1Context *v, int n) 888 static void vc1_mc_4mv_luma(VC1Context *v, int n)
1080 uvmy = uvmy + ((uvmy<0)?(uvmy&1):-(uvmy&1)); 1075 uvmy = uvmy + ((uvmy<0)?(uvmy&1):-(uvmy&1));
1081 } 1076 }
1082 1077
1083 /* Chroma MC always uses qpel bilinear */ 1078 /* Chroma MC always uses qpel bilinear */
1084 uvdxy = ((uvmy & 3) << 2) | (uvmx & 3); 1079 uvdxy = ((uvmy & 3) << 2) | (uvmx & 3);
1085 if(!v->rnd){ 1080 dsp->put_vc1_qpel_pixels_tab[uvdxy](s->dest[1], srcU, s->uvlinesize, v->rnd);
1086 dsp->put_qpel_pixels_tab[1][uvdxy](s->dest[1], srcU, s->uvlinesize); 1081 dsp->put_vc1_qpel_pixels_tab[uvdxy](s->dest[2], srcV, s->uvlinesize, v->rnd);
1087 dsp->put_qpel_pixels_tab[1][uvdxy](s->dest[2], srcV, s->uvlinesize);
1088 }else{
1089 dsp->put_no_rnd_qpel_pixels_tab[1][uvdxy](s->dest[1], srcU, s->uvlinesize);
1090 dsp->put_no_rnd_qpel_pixels_tab[1][uvdxy](s->dest[2], srcV, s->uvlinesize);
1091 }
1092 } 1082 }
1093 1083
1094 /** 1084 /**
1095 * Decode Simple/Main Profiles sequence header 1085 * Decode Simple/Main Profiles sequence header
1096 * @see Figure 7-8, p16-17 1086 * @see Figure 7-8, p16-17