Codec2BufferUtils: add support for more color aspects
This patch adds support for RANGE_FULL and BT.709 dataspace
in RGB to PlanarYUV conversion
Test: atest android.mediav2.cts.EncodeDecodeAccuracyTest
Bug: 170747332
Change-Id: Ia3314ad250cc0bafc216b087e78f3a5256b5c4d7
diff --git a/media/codec2/sfplugin/utils/Codec2BufferUtils.h b/media/codec2/sfplugin/utils/Codec2BufferUtils.h
index af29e81..9fa642d 100644
--- a/media/codec2/sfplugin/utils/Codec2BufferUtils.h
+++ b/media/codec2/sfplugin/utils/Codec2BufferUtils.h
@@ -18,6 +18,7 @@
#define CODEC2_BUFFER_UTILS_H_
#include <C2Buffer.h>
+#include <C2Config.h>
#include <C2ParamDef.h>
#include <media/hardware/VideoAPI.h>
@@ -39,7 +40,8 @@
*/
status_t ConvertRGBToPlanarYUV(
uint8_t *dstY, size_t dstStride, size_t dstVStride, size_t bufferSize,
- const C2GraphicView &src);
+ const C2GraphicView &src, C2Color::matrix_t colorMatrix = C2Color::MATRIX_BT601,
+ C2Color::range_t colorRange = C2Color::RANGE_LIMITED);
/**
* Returns a planar YUV 420 8-bit media image descriptor.