From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 199AB42EDA for ; Sun, 9 Apr 2023 12:26:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AD0B168BB52; Sun, 9 Apr 2023 15:26:17 +0300 (EEST) Received: from out-49.mta1.migadu.com (out-49.mta1.migadu.com [95.215.58.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D7BE268BA7B for ; Sun, 9 Apr 2023 15:26:10 +0300 (EEST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zanevaniperen.com; s=key1; t=1681043170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9o2ZKBRvOLm1ciyPk+/sdzdYGqg+fLkHn7T3TBZ57K0=; b=JlF2GBc7HRt/76ZnGA6sRqYWU/PYW5829O44ch9LE4yzwJOtrKyqaX17YCdq+J/Zv9qyQZ E+UKQYjoLDIp5qp1yr5sADQ4EMtXoYTuAZtbP4asibASW9jnZrTIcvcKxA4FGTuseRBczB GxI2LUewb+vZX9gMMFSpA33DqNzk+OSBalAUqpUN+9RNC/aa7/xBIXYPXGNzDmohQ6TURi WzuCeilCYoj3bdfVnND5jV7eLM5y7liHolfS7Fop7QkHRuj6rqYd3+tot8u6x1Q4ph1jLs IYAsuJMMtECvAYgfuIJHbvh5h6j9mfU5WlGFggaMtc7UAYVh0WSNXC+ASOrS1A== From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Sun, 9 Apr 2023 22:25:43 +1000 Message-Id: <20230409122543.223974-3-zane@zanevaniperen.com> In-Reply-To: <20230409122543.223974-1-zane@zanevaniperen.com> References: <20230409122543.223974-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/brenderpix: use BR_PMT_* defines for pixelmap types X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Taken from the BRender source tree at [1]. [1]: https://github.com/crocguy0688/CrocDE-BRender/blob/master/brender/inc/pixelmap.h#L19 --- libavcodec/brenderpix.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/libavcodec/brenderpix.c b/libavcodec/brenderpix.c index 52765f0c00..baadc08c7f 100644 --- a/libavcodec/brenderpix.c +++ b/libavcodec/brenderpix.c @@ -32,6 +32,20 @@ #define HEADER2_CHUNK 0x3D #define IMAGE_DATA_CHUNK 0x21 +/* + * BRender pixelmap constants taken from inc/pixelmap.h + * https://github.com/crocguy0688/CrocDE-BRender/blob/e605abee4e96e4492f2f8c7ea5e5e5bd31bcd1e3/brender/inc/pixelmap.h + */ +enum { + BR_PMT_INDEX_8 = 3, + BR_PMT_RGB_555 = 4, + BR_PMT_RGB_565 = 5, + BR_PMT_RGB_888 = 6, + BR_PMT_RGBX_888 = 7, + BR_PMT_RGBA_8888 = 8, + BR_PMT_BGR_555 = 17, +}; + /* In 8-bit colour mode, 256 colours are available at any time. Which 256 * colours are available is determined by the contents of the hardware palette * (or CLUT). In this case, the palette supplied with BRender (std.pal) has @@ -171,31 +185,31 @@ static int pix_decode_frame(AVCodecContext *avctx, AVFrame *frame, return ret; } switch (hdr.format) { - case 3: + case BR_PMT_INDEX_8: avctx->pix_fmt = AV_PIX_FMT_PAL8; bytes_pp = 1; break; - case 4: + case BR_PMT_RGB_555: avctx->pix_fmt = AV_PIX_FMT_RGB555BE; bytes_pp = 2; break; - case 5: + case BR_PMT_RGB_565: avctx->pix_fmt = AV_PIX_FMT_RGB565BE; bytes_pp = 2; break; - case 6: + case BR_PMT_RGB_888: avctx->pix_fmt = AV_PIX_FMT_RGB24; bytes_pp = 3; break; - case 7: + case BR_PMT_RGBX_888: avctx->pix_fmt = AV_PIX_FMT_0RGB; bytes_pp = 4; break; - case 8: // ARGB + case BR_PMT_RGBA_8888: /* It says RGBA, but it's actually ARGB. */ avctx->pix_fmt = AV_PIX_FMT_ARGB; bytes_pp = 4; break; - case 17: + case BR_PMT_BGR_555: avctx->pix_fmt = AV_PIX_FMT_BGR555BE; bytes_pp = 2; break; -- 2.39.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".