Skip to content

Instantly share code, notes, and snippets.

@hatt
Created July 29, 2012 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatt/3195998 to your computer and use it in GitHub Desktop.
Save hatt/3195998 to your computer and use it in GitHub Desktop.
AVISynth planeswap.cpp
const int pitch = dst->GetPitch(PLANAR_U)/4;
const int myx = (dst->GetRowSize(PLANAR_U)+3)/4;
const int myy = dst->GetHeight(PLANAR_U);
int *srcpUV = (int*)dst->GetWritePtr(PLANAR_U);
for (int y=0; y<myy; y++) {
for (int x=0; x<myx; x++) {
srcpUV[x] = 0x80808080; // mod 8
}
srcpUV += pitch;
}
srcpUV = (int*)dst->GetWritePtr(PLANAR_V);
for (int y=0; y<myy; ++y) {
for (int x=0; x<myx; x++) {
srcpUV[x] = 0x80808080; // mod 8
}
srcpUV += pitch;
}
return dst;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment