diff mbox series

[kms++,1/4] kms++: PixelFormats: Fix formatting

Message ID 20221202131658.434114-2-tomi.valkeinen+renesas@ideasonboard.com (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series Support Y210 | expand

Commit Message

Tomi Valkeinen Dec. 2, 2022, 1:16 p.m. UTC
Fix formatting for some pixel formats.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
 kms++/src/pixelformats.cpp | 60 +++++++-------------------------------
 1 file changed, 10 insertions(+), 50 deletions(-)

Comments

Laurent Pinchart Dec. 2, 2022, 11:50 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Fri, Dec 02, 2022 at 03:16:55PM +0200, Tomi Valkeinen wrote:
> Fix formatting for some pixel formats.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> ---
>  kms++/src/pixelformats.cpp | 60 +++++++-------------------------------
>  1 file changed, 10 insertions(+), 50 deletions(-)
> 
> diff --git a/kms++/src/pixelformats.cpp b/kms++/src/pixelformats.cpp
> index d739efd..7afbf09 100644
> --- a/kms++/src/pixelformats.cpp
> +++ b/kms++/src/pixelformats.cpp
> @@ -32,107 +32,67 @@ static const map<PixelFormat, PixelFormatInfo> format_info_array = {
>  	{ PixelFormat::NV12, {
>  				     PixelColorType::YUV,
>  				     2,
> -				     { {
> -					       8,
> -					       1,
> -					       1,
> -				       },
> +				     { { 8, 1, 1 },
>  				       { 8, 2, 2 } },
>  			     } },

While at it I would probably have reformated everything as

	{ PixelFormat::NV12, {
		PixelColorType::YUV,
		2,
		{
			{ 8, 1, 1 },
			{ 8, 2, 2 }
		},
	} },

or

	{ PixelFormat::NV12, {
		PixelColorType::YUV,
		2,
		{ { 8, 1, 1 }, { 8, 2, 2 } },
	} },

to make the table more compact (and I believe more readable), but that's
entirely up to you.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  	{ PixelFormat::NV21, {
>  				     PixelColorType::YUV,
>  				     2,
> -				     { {
> -					       8,
> -					       1,
> -					       1,
> -				       },
> +				     { { 8, 1, 1 },
>  				       { 8, 2, 2 } },
>  			     } },
>  	{ PixelFormat::NV16, {
>  				     PixelColorType::YUV,
>  				     2,
> -				     { {
> -					       8,
> -					       1,
> -					       1,
> -				       },
> +				     { { 8, 1, 1 },
>  				       { 8, 2, 1 } },
>  			     } },
>  	{ PixelFormat::NV61, {
>  				     PixelColorType::YUV,
>  				     2,
> -				     { {
> -					       8,
> -					       1,
> -					       1,
> -				       },
> +				     { { 8, 1, 1 },
>  				       { 8, 2, 1 } },
>  			     } },
>  	/* YUV planar */
>  	{ PixelFormat::YUV420, {
>  				       PixelColorType::YUV,
>  				       3,
> -				       { {
> -						 8,
> -						 1,
> -						 1,
> -					 },
> +				       { { 8, 1, 1 },
>  					 { 8, 2, 2 },
>  					 { 8, 2, 2 } },
>  			       } },
>  	{ PixelFormat::YVU420, {
>  				       PixelColorType::YUV,
>  				       3,
> -				       { {
> -						 8,
> -						 1,
> -						 1,
> -					 },
> +				       { { 8, 1, 1 },
>  					 { 8, 2, 2 },
>  					 { 8, 2, 2 } },
>  			       } },
>  	{ PixelFormat::YUV422, {
>  				       PixelColorType::YUV,
>  				       3,
> -				       { {
> -						 8,
> -						 1,
> -						 1,
> -					 },
> +				       { { 8, 1, 1 },
>  					 { 8, 2, 1 },
>  					 { 8, 2, 1 } },
>  			       } },
>  	{ PixelFormat::YVU422, {
>  				       PixelColorType::YUV,
>  				       3,
> -				       { {
> -						 8,
> -						 1,
> -						 1,
> -					 },
> +				       { { 8, 1, 1 },
>  					 { 8, 2, 1 },
>  					 { 8, 2, 1 } },
>  			       } },
>  	{ PixelFormat::YUV444, {
>  				       PixelColorType::YUV,
>  				       3,
> -				       { {
> -						 8,
> -						 1,
> -						 1,
> -					 },
> +				       { { 8, 1, 1 },
>  					 { 8, 1, 1 },
>  					 { 8, 1, 1 } },
>  			       } },
>  	{ PixelFormat::YVU444, {
>  				       PixelColorType::YUV,
>  				       3,
> -				       { {
> -						 8,
> -						 1,
> -						 1,
> -					 },
> +				       { { 8, 1, 1 },
>  					 { 8, 1, 1 },
>  					 { 8, 1, 1 } },
>  			       } },
diff mbox series

Patch

diff --git a/kms++/src/pixelformats.cpp b/kms++/src/pixelformats.cpp
index d739efd..7afbf09 100644
--- a/kms++/src/pixelformats.cpp
+++ b/kms++/src/pixelformats.cpp
@@ -32,107 +32,67 @@  static const map<PixelFormat, PixelFormatInfo> format_info_array = {
 	{ PixelFormat::NV12, {
 				     PixelColorType::YUV,
 				     2,
-				     { {
-					       8,
-					       1,
-					       1,
-				       },
+				     { { 8, 1, 1 },
 				       { 8, 2, 2 } },
 			     } },
 	{ PixelFormat::NV21, {
 				     PixelColorType::YUV,
 				     2,
-				     { {
-					       8,
-					       1,
-					       1,
-				       },
+				     { { 8, 1, 1 },
 				       { 8, 2, 2 } },
 			     } },
 	{ PixelFormat::NV16, {
 				     PixelColorType::YUV,
 				     2,
-				     { {
-					       8,
-					       1,
-					       1,
-				       },
+				     { { 8, 1, 1 },
 				       { 8, 2, 1 } },
 			     } },
 	{ PixelFormat::NV61, {
 				     PixelColorType::YUV,
 				     2,
-				     { {
-					       8,
-					       1,
-					       1,
-				       },
+				     { { 8, 1, 1 },
 				       { 8, 2, 1 } },
 			     } },
 	/* YUV planar */
 	{ PixelFormat::YUV420, {
 				       PixelColorType::YUV,
 				       3,
-				       { {
-						 8,
-						 1,
-						 1,
-					 },
+				       { { 8, 1, 1 },
 					 { 8, 2, 2 },
 					 { 8, 2, 2 } },
 			       } },
 	{ PixelFormat::YVU420, {
 				       PixelColorType::YUV,
 				       3,
-				       { {
-						 8,
-						 1,
-						 1,
-					 },
+				       { { 8, 1, 1 },
 					 { 8, 2, 2 },
 					 { 8, 2, 2 } },
 			       } },
 	{ PixelFormat::YUV422, {
 				       PixelColorType::YUV,
 				       3,
-				       { {
-						 8,
-						 1,
-						 1,
-					 },
+				       { { 8, 1, 1 },
 					 { 8, 2, 1 },
 					 { 8, 2, 1 } },
 			       } },
 	{ PixelFormat::YVU422, {
 				       PixelColorType::YUV,
 				       3,
-				       { {
-						 8,
-						 1,
-						 1,
-					 },
+				       { { 8, 1, 1 },
 					 { 8, 2, 1 },
 					 { 8, 2, 1 } },
 			       } },
 	{ PixelFormat::YUV444, {
 				       PixelColorType::YUV,
 				       3,
-				       { {
-						 8,
-						 1,
-						 1,
-					 },
+				       { { 8, 1, 1 },
 					 { 8, 1, 1 },
 					 { 8, 1, 1 } },
 			       } },
 	{ PixelFormat::YVU444, {
 				       PixelColorType::YUV,
 				       3,
-				       { {
-						 8,
-						 1,
-						 1,
-					 },
+				       { { 8, 1, 1 },
 					 { 8, 1, 1 },
 					 { 8, 1, 1 } },
 			       } },