mirror of https://github.com/mpv-player/mpv
faster packed<->planar conversation
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14284 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
0b7d411ad4
commit
f3f2e49ee2
|
@ -118,9 +118,18 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(j=0; j<in_len; j++){
|
if(chans==1){
|
||||||
for(i=0; i<chans; i++){
|
memcpy(&s->in[0][s->index], in, in_len * sizeof(int16_t));
|
||||||
s->in[i][j + s->index]= *(in++);
|
}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;
|
in_len += s->index;
|
||||||
|
@ -135,9 +144,18 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
|
||||||
memmove(s->in[i], s->in[i] + consumed, s->index*sizeof(int16_t));
|
memmove(s->in[i], s->in[i] + consumed, s->index*sizeof(int16_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(j=0; j<out_len; j++){
|
if(chans==1){
|
||||||
for(i=0; i<chans; i++){
|
memcpy(out, tmp[0], out_len*sizeof(int16_t));
|
||||||
*(out++)= tmp[i][j];
|
}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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue