mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
codecparsers: VC1: Implement bitplanes diff operator
This commit is contained in:
parent
8090627581
commit
ce71fdae1b
1 changed files with 26 additions and 2 deletions
|
@ -564,6 +564,30 @@ bitplane_decoding (GstBitReader * br, guint8 * data,
|
|||
break;
|
||||
}
|
||||
|
||||
if (!data)
|
||||
return TRUE;
|
||||
|
||||
/* Applying diff operator */
|
||||
if (imode == IMODE_DIFF2 || imode == IMODE_DIFF6) {
|
||||
pdata = data;
|
||||
pdata[0] ^= invert;
|
||||
|
||||
for (x = 1; x < width; x++)
|
||||
pdata[x] ^= pdata[x - 1];
|
||||
|
||||
for (y = 1; y < height; y++) {
|
||||
pdata[stride] ^= pdata[0];
|
||||
|
||||
for (x = 1; x < width; x++) {
|
||||
if (pdata[stride + x - 1] != pdata[x])
|
||||
pdata[stride + x] ^= invert;
|
||||
else
|
||||
pdata[stride + x] ^= pdata[stride + x - 1];
|
||||
}
|
||||
pdata += stride;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
failed:
|
||||
|
|
Loading…
Reference in a new issue