mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avcodec/lcevc_parser: move pixel format table to a shared file
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -81,4 +81,34 @@ enum {
|
||||
LCEVC_ADDITIONAL_INFO_TYPE_VUI = 1,
|
||||
};
|
||||
|
||||
/*
|
||||
* Table 21 — Colour format for the decoded picture
|
||||
*/
|
||||
enum {
|
||||
LCEVC_CHROMA_SAMPLING_TYPE_400 = 0,
|
||||
LCEVC_CHROMA_SAMPLING_TYPE_420 = 1,
|
||||
LCEVC_CHROMA_SAMPLING_TYPE_422 = 2,
|
||||
LCEVC_CHROMA_SAMPLING_TYPE_444 = 3,
|
||||
};
|
||||
|
||||
/*
|
||||
* Table 23 — Bit depth of the decoded base picture
|
||||
*/
|
||||
enum {
|
||||
LCEVC_BASE_DEPTH_TYPE_8 = 0,
|
||||
LCEVC_BASE_DEPTH_TYPE_10 = 1,
|
||||
LCEVC_BASE_DEPTH_TYPE_12 = 2,
|
||||
LCEVC_BASE_DEPTH_TYPE_14 = 3,
|
||||
};
|
||||
|
||||
/*
|
||||
* Table 24 — Bit depth of the decoded picture
|
||||
*/
|
||||
enum {
|
||||
LCEVC_ENHANCEMENT_DEPTH_TYPE_8 = 0,
|
||||
LCEVC_ENHANCEMENT_DEPTH_TYPE_10 = 1,
|
||||
LCEVC_ENHANCEMENT_DEPTH_TYPE_12 = 2,
|
||||
LCEVC_ENHANCEMENT_DEPTH_TYPE_14 = 3,
|
||||
};
|
||||
|
||||
#endif /* AVCODEC_LCEVC_H */
|
||||
|
||||
@@ -72,17 +72,6 @@ static int lcevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf,
|
||||
return END_NOT_FOUND;
|
||||
}
|
||||
|
||||
static const enum AVPixelFormat pix_fmts[4][4] = {
|
||||
{ AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, },
|
||||
{ AV_PIX_FMT_GRAY10, AV_PIX_FMT_YUV420P10,
|
||||
AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, },
|
||||
{ AV_PIX_FMT_GRAY12, AV_PIX_FMT_YUV420P12,
|
||||
AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, },
|
||||
{ AV_PIX_FMT_GRAY14, AV_PIX_FMT_YUV420P14,
|
||||
AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV444P14, },
|
||||
};
|
||||
|
||||
static int parse_nal_unit(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
const H2645NAL *nal)
|
||||
{
|
||||
@@ -131,7 +120,7 @@ static int parse_nal_unit(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
skip_bits(&gb, 2);
|
||||
bit_depth = get_bits(&gb, 2); // enhancement_depth_type
|
||||
|
||||
s->format = pix_fmts[bit_depth][chroma_format_idc];
|
||||
s->format = ff_lcevc_depth_type[bit_depth][chroma_format_idc];
|
||||
|
||||
if (resolution_type < 63) {
|
||||
s->width = ff_lcevc_resolution_type[resolution_type].width;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "lcevc.h"
|
||||
#include "lcevctab.h"
|
||||
|
||||
const struct FFLCEVCDim ff_lcevc_resolution_type[63] = {
|
||||
@@ -33,3 +34,14 @@ const struct FFLCEVCDim ff_lcevc_resolution_type[63] = {
|
||||
{ 5120, 4096 }, { 6400, 4096 }, { 6400, 4800 }, { 7680, 4320 },
|
||||
{ 7680, 4800 },
|
||||
};
|
||||
|
||||
const enum AVPixelFormat ff_lcevc_depth_type[4][4] = {
|
||||
[LCEVC_BASE_DEPTH_TYPE_8] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P },
|
||||
[LCEVC_BASE_DEPTH_TYPE_10] = { AV_PIX_FMT_GRAY10, AV_PIX_FMT_YUV420P10,
|
||||
AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10 },
|
||||
[LCEVC_BASE_DEPTH_TYPE_12] = { AV_PIX_FMT_GRAY12, AV_PIX_FMT_YUV420P12,
|
||||
AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12 },
|
||||
[LCEVC_BASE_DEPTH_TYPE_14] = { AV_PIX_FMT_GRAY14, AV_PIX_FMT_YUV420P14,
|
||||
AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV444P14 },
|
||||
};
|
||||
|
||||
@@ -22,10 +22,13 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes_internal.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
|
||||
EXTERN const struct FFLCEVCDim {
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
} ff_lcevc_resolution_type[63];
|
||||
|
||||
EXTERN const enum AVPixelFormat ff_lcevc_depth_type[4][4];
|
||||
|
||||
#endif /* AVCODEC_LCEVCTAB_H */
|
||||
|
||||
Reference in New Issue
Block a user