diff mbox series

[FFmpeg-devel,31/46] avcodec/r210enc: Deduplicate pix_fmts arrays

Message ID HE1PR0301MB2154AA93EB3D08745C4361378F5F9@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Headers show
Series [FFmpeg-devel,01/46] avcodec/a64multienc: Avoid intermediate buffer
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 29, 2021, 11:57 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/r210enc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c
index b143f516c1..2f641223d4 100644
--- a/libavcodec/r210enc.c
+++ b/libavcodec/r210enc.c
@@ -86,6 +86,7 @@  static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     return 0;
 }
 
+static const enum AVPixelFormat pix_fmt[] = { AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE };
 
 #if CONFIG_R210_ENCODER
 const AVCodec ff_r210_encoder = {
@@ -96,7 +97,7 @@  const AVCodec ff_r210_encoder = {
     .capabilities   = AV_CODEC_CAP_DR1,
     .init           = encode_init,
     .encode2        = encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE },
+    .pix_fmts       = pix_fmt,
 };
 #endif
 #if CONFIG_R10K_ENCODER
@@ -108,7 +109,7 @@  const AVCodec ff_r10k_encoder = {
     .capabilities   = AV_CODEC_CAP_DR1,
     .init           = encode_init,
     .encode2        = encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE },
+    .pix_fmts       = pix_fmt,
 };
 #endif
 #if CONFIG_AVRP_ENCODER
@@ -120,6 +121,6 @@  const AVCodec ff_avrp_encoder = {
     .capabilities   = AV_CODEC_CAP_DR1,
     .init           = encode_init,
     .encode2        = encode_frame,
-    .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE },
+    .pix_fmts       = pix_fmt,
 };
 #endif