Bug 551277 - Replace liboggplay YUV to RGB color conversion code - r=roc

This commit is contained in:
Chris Double
2010-04-19 13:17:06 +12:00
parent be316e0668
commit 405d052c63
29 changed files with 3982 additions and 121 deletions

View File

@@ -206,7 +206,22 @@ protected:
/**
* We assume that the image data is in the REC 470M color space (see
* Theora specification, section 4.3.1).
* XXX Eventually we should some color space parameter(s) here.
*
* The YCbCr format can be:
*
* 4:4:4 - CbCr width/height are the same as Y.
* 4:2:2 - CbCr width is half that of Y. Height is the same.
* 4:2:0 - CbCr width and height is half that of Y.
*
* The color format is detected based on the height/width ratios
* defined above.
*
* The Image that is rendered is the picture region defined by
* mPicX, mPicY and mPicSize. The size of the rendered image is
* mPicSize, not mYSize or mCbCrSize.
*
* Note: The color-conversion code does not currently support 4:4:4
* and an error is raised in this case. See bug 551378.
*/
class THEBES_API PlanarYCbCrImage : public Image {
public:
@@ -220,16 +235,12 @@ public:
PRUint8* mCrChannel;
PRInt32 mCbCrStride;
gfxIntSize mCbCrSize;
// Picture region
PRUint32 mPicX;
PRUint32 mPicY;
gfxIntSize mPicSize;
};
typedef void (* ToARGBHook)(const Data& aData, PRUint8* aOutput);
/**
* XXX this is just a hack until we can get YCbCr conversion code into
* gfx
* This must be called before SetData().
*/
virtual void SetRGBConverter(ToARGBHook aHook) {}
/**
* This makes a copy of the data buffers.
* XXX Eventually we will change this to not make a copy of the data,