FFmpeg
Loading...
Searching...
No Matches
proresenc_kostya_common.h
Go to the documentation of this file.
1/*
2 * Apple ProRes encoder
3 *
4 * Copyright (c) 2011 Anatoliy Wasserman
5 * Copyright (c) 2012 Konstantin Shishkov
6 *
7 * This file is part of FFmpeg.
8 *
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#ifndef AVCODEC_PRORESENC_KOSTYA_COMMON_H
25#define AVCODEC_PRORESENC_KOSTYA_COMMON_H
26
27#include <stddef.h>
28
30#include "libavutil/log.h"
32#include "libavutil/pixfmt.h"
33#include "fdctdsp.h"
34
36
37#define CFACTOR_Y422 2
38#define CFACTOR_Y444 3
39
40#define MAX_MBS_PER_SLICE 8
41
42#define MAX_PLANES 4
43
44#define NUM_MB_LIMITS 4
45
46#define MAX_STORED_Q 16
47
48enum {
56};
57
58enum {
66};
67
68struct AVCodecContext;
69struct AVFrame;
70
71typedef struct prores_profile {
72 const char *full_name;
73 uint32_t tag;
77 int quant;
80
81typedef struct ProresContext {
82 AVClass *class;
84 DECLARE_ALIGNED(16, uint16_t, emu_buf)[16*16];
85 int16_t quants[MAX_STORED_Q][64];
87 int16_t custom_q[64];
88 int16_t custom_chroma_q[64];
89 const uint8_t *quant_mat;
90 const uint8_t *quant_chroma_mat;
91 const uint8_t *scantable;
92
93 void (*fdct)(FDCTDSPContext *fdsp, const uint16_t *src,
94 ptrdiff_t linesize, int16_t *block);
96
97 const struct AVFrame *pic;
103 int pictures_per_frame; // 1 for progressive, 2 for interlaced
109 int warn;
110
111 char *vendor;
113
115
118
120
123
125 enum AVPixelFormat pixfmt);
126
128 uint8_t **orig_buf, int flags,
130 enum AVColorTransferCharacteristic color_trc,
131 enum AVColorSpace colorspace);
132
134
136
137#endif // AVCODEC_PRORESENC_KOSTYA_COMMON_H
#define FF_VISIBILITY_PUSH_HIDDEN
#define FF_VISIBILITY_POP_HIDDEN
#define flags(name, subs,...)
Definition cbs_h264.c:74
static const AVColorPrimariesDesc color_primaries[AVCOL_PRI_NB]
Definition csp.c:76
static int16_t block[64]
Definition dct.c:125
enum AVPixelFormat pixfmt
Definition kmsgrab.c:367
#define av_cold
Definition attributes.h:117
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
pixel format definitions
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition pixfmt.h:642
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition pixfmt.h:672
AVColorSpace
YUV colorspace type.
Definition pixfmt.h:706
av_cold int ff_prores_kostya_encode_init(struct AVCodecContext *avctx, ProresContext *ctx, enum AVPixelFormat pixfmt)
#define MAX_PLANES
@ QUANT_MAT_STANDARD
@ QUANT_MAT_XQ_LUMA
@ QUANT_MAT_DEFAULT
@ QUANT_MAT_PROXY_CHROMA
uint8_t * ff_prores_kostya_write_picture_header(ProresContext *ctx, uint8_t *buf)
uint8_t * ff_prores_kostya_write_frame_header(struct AVCodecContext *avctx, ProresContext *ctx, uint8_t **orig_buf, int flags, enum AVColorPrimaries color_primaries, enum AVColorTransferCharacteristic color_trc, enum AVColorSpace colorspace)
@ PRORES_PROFILE_4444
@ PRORES_PROFILE_STANDARD
@ PRORES_PROFILE_LT
@ PRORES_PROFILE_4444XQ
@ PRORES_PROFILE_AUTO
@ PRORES_PROFILE_HQ
@ PRORES_PROFILE_PROXY
#define MAX_MBS_PER_SLICE
#define NUM_MB_LIMITS
#define MAX_STORED_Q
Describe the class of an AVClass context structure.
Definition log.h:76
main external API structure.
Definition avcodec.h:443
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
unsigned mb_height
height of the current picture in mb
Definition proresdec.h:54
FDCTDSPContext fdsp
const struct prores_profile * profile_info
struct ProresThreadData * tdata
int16_t quants[MAX_STORED_Q][64]
uint16_t emu_buf[16 *16]
const uint8_t * quant_mat
int16_t blocks[MAX_PLANES][64 *4 *MAX_MBS_PER_SLICE]
int16_t quants_chroma[MAX_STORED_Q][64]
const uint8_t * quant_chroma_mat
const uint8_t * scantable
void(* fdct)(FDCTDSPContext *fdsp, const uint16_t *src, ptrdiff_t linesize, int16_t *block)
unsigned mb_width
width of the current picture in mb
Definition proresdec.h:53
const struct AVFrame * pic
int br_tab[NUM_MB_LIMITS]
#define src
Definition vp8dsp.c:248
static AVFormatContext * ctx
Definition movenc.c:49