From patchwork Mon Aug 22 00:09:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Gu X-Patchwork-Id: 232 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp1463154vsd; Sun, 21 Aug 2016 17:09:34 -0700 (PDT) X-Received: by 10.194.11.72 with SMTP id o8mr14521869wjb.10.1471824574361; Sun, 21 Aug 2016 17:09:34 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i184si13713500wmg.143.2016.08.21.17.09.33; Sun, 21 Aug 2016 17:09:34 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B6EFA689B32; Mon, 22 Aug 2016 03:09:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pa0-f67.google.com (mail-pa0-f67.google.com [209.85.220.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5A438689B07 for ; Mon, 22 Aug 2016 03:09:06 +0300 (EEST) Received: by mail-pa0-f67.google.com with SMTP id vy10so6985934pac.0 for ; Sun, 21 Aug 2016 17:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Bc+s7Wd6RztA5iwihmJ75Dfpk7lAcvUwf+RxQU+OyzQ=; b=l1ZA775MKmwxdS1mpTwF/ZxR6SlnqdPovh7dtIA6yKEn/4daeLXSngh88qRHfp+rA1 CZrX9/vgsyUIpqWnUe2guezk9BRF6H4R4RdkxAhVd/Ubqoi2NAiR74mMlmY8pAphiqg8 K8S+3fYXRRktZ+7KY0fnQ13ycJYL39+roEsLRe6GXXhPIZDEdUtLjQeoCSW/0AwnVKHh 5ziGHH5Q+3W6D/IuxpAZgmqoDdqxGmiDx/NEkuErrWkQzLmoBfDrvc2QFTIphw4PusyU S7FVGQHqK5jfHs2ZwUnmJ60XoAQuyFwROBds43DLpQbw2NUjRTn9VyI1u1yzFj1nMpUw lOcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Bc+s7Wd6RztA5iwihmJ75Dfpk7lAcvUwf+RxQU+OyzQ=; b=b6NfgA9+qfykVVDSoxArD12arJWkJL9+gvuFxA5WismKeMR58piVgnRVr5hCBx5LpZ YhFGxUwMTMHdPbFtRCSv/KHp/NRnZHZAGg0AxupESUFBI1P2fjbmgqsqVBDLwB6l1OXW 5ZjSTk0XSQunJzpxnYOINgq6qEK2Kq6RuinBeunC6LhpGES2vU+ObNhgAo3l1JSac1f5 zSc1SQFx5+a9p30PtRj0tgE0FSsbNQc1mN1aOafw66+ygbHRdwrnTLP/Q4UFpN1YRX94 3/BISSs7vSlmCLfqKGpBscM5vds4qePSL4K2iNLZsfTuyvhmIRkUurUPG9F2ys5TNpSq 3XlQ== X-Gm-Message-State: AEkoouvJ7nBCyDHXBLtB3eJd5lSGkTX47LBL3Z1VJXnjQBbPxdp3MdtiajzhpLol6GKflQ== X-Received: by 10.66.153.163 with SMTP id vh3mr37667906pab.0.1471824545880; Sun, 21 Aug 2016 17:09:05 -0700 (PDT) Received: from biggie.timothygu.me (ip68-5-186-115.oc.oc.cox.net. [68.5.186.115]) by smtp.gmail.com with ESMTPSA id y3sm22400313pfd.65.2016.08.21.17.09.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Aug 2016 17:09:05 -0700 (PDT) From: Timothy Gu To: ffmpeg-devel@ffmpeg.org Date: Sun, 21 Aug 2016 17:09:00 -0700 Message-Id: <1471824541-19677-1-git-send-email-timothygu99@gmail.com> X-Mailer: git-send-email 2.1.4 Subject: [FFmpeg-devel] [PATCH 1/2] pixdesc: Order function prototypes semantically X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: Timothy Gu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavutil/pixdesc.h | 194 ++++++++++++++++++++++++++-------------------------- 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h index 3b0bcdb..a8ad588 100644 --- a/libavutil/pixdesc.h +++ b/libavutil/pixdesc.h @@ -173,78 +173,6 @@ typedef struct AVPixFmtDescriptor { #define AV_PIX_FMT_FLAG_ALPHA (1 << 7) /** - * Read a line from an image, and write the values of the - * pixel format component c to dst. - * - * @param data the array containing the pointers to the planes of the image - * @param linesize the array containing the linesizes of the image - * @param desc the pixel format descriptor for the image - * @param x the horizontal coordinate of the first pixel to read - * @param y the vertical coordinate of the first pixel to read - * @param w the width of the line to read, that is the number of - * values to write to dst - * @param read_pal_component if not zero and the format is a paletted - * format writes the values corresponding to the palette - * component c in data[1] to dst, rather than the palette indexes in - * data[0]. The behavior is undefined if the format is not paletted. - */ -void av_read_image_line(uint16_t *dst, const uint8_t *data[4], - const int linesize[4], const AVPixFmtDescriptor *desc, - int x, int y, int c, int w, int read_pal_component); - -/** - * Write the values from src to the pixel format component c of an - * image line. - * - * @param src array containing the values to write - * @param data the array containing the pointers to the planes of the - * image to write into. It is supposed to be zeroed. - * @param linesize the array containing the linesizes of the image - * @param desc the pixel format descriptor for the image - * @param x the horizontal coordinate of the first pixel to write - * @param y the vertical coordinate of the first pixel to write - * @param w the width of the line to write, that is the number of - * values to write to the image line - */ -void av_write_image_line(const uint16_t *src, uint8_t *data[4], - const int linesize[4], const AVPixFmtDescriptor *desc, - int x, int y, int c, int w); - -/** - * Return the pixel format corresponding to name. - * - * If there is no pixel format with name name, then looks for a - * pixel format with the name corresponding to the native endian - * format of name. - * For example in a little-endian system, first looks for "gray16", - * then for "gray16le". - * - * Finally if no pixel format has been found, returns AV_PIX_FMT_NONE. - */ -enum AVPixelFormat av_get_pix_fmt(const char *name); - -/** - * Return the short name for a pixel format, NULL in case pix_fmt is - * unknown. - * - * @see av_get_pix_fmt(), av_get_pix_fmt_string() - */ -const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt); - -/** - * Print in buf the string corresponding to the pixel format with - * number pix_fmt, or a header if pix_fmt is negative. - * - * @param buf the buffer where to write the string - * @param buf_size the size of buf - * @param pix_fmt the number of the pixel format to print the - * corresponding info string, or a negative value to print the - * corresponding header. - */ -char *av_get_pix_fmt_string(char *buf, int buf_size, - enum AVPixelFormat pix_fmt); - -/** * Return the number of bits per pixel used by the pixel format * described by pixdesc. Note that this is not the same as the number * of bits per sample. @@ -307,6 +235,103 @@ int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt); /** + * @return the name for provided color range or NULL if unknown. + */ +const char *av_color_range_name(enum AVColorRange range); + +/** + * @return the name for provided color primaries or NULL if unknown. + */ +const char *av_color_primaries_name(enum AVColorPrimaries primaries); + +/** + * @return the name for provided color transfer or NULL if unknown. + */ +const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer); + +/** + * @return the name for provided color space or NULL if unknown. + */ +const char *av_color_space_name(enum AVColorSpace space); + +/** + * @return the name for provided chroma location or NULL if unknown. + */ +const char *av_chroma_location_name(enum AVChromaLocation location); + +/** + * Return the pixel format corresponding to name. + * + * If there is no pixel format with name name, then looks for a + * pixel format with the name corresponding to the native endian + * format of name. + * For example in a little-endian system, first looks for "gray16", + * then for "gray16le". + * + * Finally if no pixel format has been found, returns AV_PIX_FMT_NONE. + */ +enum AVPixelFormat av_get_pix_fmt(const char *name); + +/** + * Return the short name for a pixel format, NULL in case pix_fmt is + * unknown. + * + * @see av_get_pix_fmt(), av_get_pix_fmt_string() + */ +const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt); + +/** + * Print in buf the string corresponding to the pixel format with + * number pix_fmt, or a header if pix_fmt is negative. + * + * @param buf the buffer where to write the string + * @param buf_size the size of buf + * @param pix_fmt the number of the pixel format to print the + * corresponding info string, or a negative value to print the + * corresponding header. + */ +char *av_get_pix_fmt_string(char *buf, int buf_size, + enum AVPixelFormat pix_fmt); + +/** + * Read a line from an image, and write the values of the + * pixel format component c to dst. + * + * @param data the array containing the pointers to the planes of the image + * @param linesize the array containing the linesizes of the image + * @param desc the pixel format descriptor for the image + * @param x the horizontal coordinate of the first pixel to read + * @param y the vertical coordinate of the first pixel to read + * @param w the width of the line to read, that is the number of + * values to write to dst + * @param read_pal_component if not zero and the format is a paletted + * format writes the values corresponding to the palette + * component c in data[1] to dst, rather than the palette indexes in + * data[0]. The behavior is undefined if the format is not paletted. + */ +void av_read_image_line(uint16_t *dst, const uint8_t *data[4], + const int linesize[4], const AVPixFmtDescriptor *desc, + int x, int y, int c, int w, int read_pal_component); + +/** + * Write the values from src to the pixel format component c of an + * image line. + * + * @param src array containing the values to write + * @param data the array containing the pointers to the planes of the + * image to write into. It is supposed to be zeroed. + * @param linesize the array containing the linesizes of the image + * @param desc the pixel format descriptor for the image + * @param x the horizontal coordinate of the first pixel to write + * @param y the vertical coordinate of the first pixel to write + * @param w the width of the line to write, that is the number of + * values to write to the image line + */ +void av_write_image_line(const uint16_t *src, uint8_t *data[4], + const int linesize[4], const AVPixFmtDescriptor *desc, + int x, int y, int c, int w); + +/** * Utility function to swap the endianness of a pixel format. * * @param[in] pix_fmt the pixel format @@ -366,29 +391,4 @@ int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); -/** - * @return the name for provided color range or NULL if unknown. - */ -const char *av_color_range_name(enum AVColorRange range); - -/** - * @return the name for provided color primaries or NULL if unknown. - */ -const char *av_color_primaries_name(enum AVColorPrimaries primaries); - -/** - * @return the name for provided color transfer or NULL if unknown. - */ -const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer); - -/** - * @return the name for provided color space or NULL if unknown. - */ -const char *av_color_space_name(enum AVColorSpace space); - -/** - * @return the name for provided chroma location or NULL if unknown. - */ -const char *av_chroma_location_name(enum AVChromaLocation location); - #endif /* AVUTIL_PIXDESC_H */