[MPlayer-cvslog] CVS: main/libaf af_lavcresample.c,1.6,1.7
Michael Niedermayer CVS
syncmail at mplayerhq.hu
Fri Dec 31 14:14:04 CET 2004
CVS change done by Michael Niedermayer CVS
Update of /cvsroot/mplayer/main/libaf
In directory mail:/var2/tmp/cvs-serv17965
Modified Files:
af_lavcresample.c
Log Message:
faster packed<->planar conversation
Index: af_lavcresample.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af_lavcresample.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- af_lavcresample.c 27 Dec 2004 17:30:13 -0000 1.6
+++ af_lavcresample.c 31 Dec 2004 13:14:01 -0000 1.7
@@ -118,9 +118,18 @@
}
}
- for(j=0; j<in_len; j++){
- for(i=0; i<chans; i++){
- s->in[i][j + s->index]= *(in++);
+ if(chans==1){
+ memcpy(&s->in[0][s->index], in, in_len * sizeof(int16_t));
+ }else if(chans==2){
+ for(j=0; j<in_len; j++){
+ s->in[0][j + s->index]= *(in++);
+ s->in[1][j + s->index]= *(in++);
+ }
+ }else{
+ for(j=0; j<in_len; j++){
+ for(i=0; i<chans; i++){
+ s->in[i][j + s->index]= *(in++);
+ }
}
}
in_len += s->index;
@@ -135,9 +144,18 @@
memmove(s->in[i], s->in[i] + consumed, s->index*sizeof(int16_t));
}
- for(j=0; j<out_len; j++){
- for(i=0; i<chans; i++){
- *(out++)= tmp[i][j];
+ if(chans==1){
+ memcpy(out, tmp[0], out_len*sizeof(int16_t));
+ }else if(chans==2){
+ for(j=0; j<out_len; j++){
+ *(out++)= tmp[0][j];
+ *(out++)= tmp[1][j];
+ }
+ }else{
+ for(j=0; j<out_len; j++){
+ for(i=0; i<chans; i++){
+ *(out++)= tmp[i][j];
+ }
}
}
More information about the MPlayer-cvslog
mailing list