mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 00:32:31 +00:00
libavcodec/dnxhd: add dnxhr profiles
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a06acfff76
commit
41d7642a7b
@ -3173,6 +3173,13 @@ typedef struct AVCodecContext {
|
||||
#define FF_PROFILE_MPEG2_AAC_LOW 128
|
||||
#define FF_PROFILE_MPEG2_AAC_HE 131
|
||||
|
||||
#define FF_PROFILE_DNXHD 0
|
||||
#define FF_PROFILE_DNXHR_LB 1
|
||||
#define FF_PROFILE_DNXHR_SQ 2
|
||||
#define FF_PROFILE_DNXHR_HQ 3
|
||||
#define FF_PROFILE_DNXHR_HQX 4
|
||||
#define FF_PROFILE_DNXHR_444 5
|
||||
|
||||
#define FF_PROFILE_DTS 20
|
||||
#define FF_PROFILE_DTS_ES 30
|
||||
#define FF_PROFILE_DTS_96_24 40
|
||||
|
@ -665,6 +665,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
|
||||
.name = "dnxhd",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
|
||||
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
|
||||
.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
|
||||
},
|
||||
{
|
||||
.id = AV_CODEC_ID_THP,
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "dnxhddata.h"
|
||||
#include "idctdsp.h"
|
||||
#include "internal.h"
|
||||
#include "profiles.h"
|
||||
#include "thread.h"
|
||||
|
||||
typedef struct RowContext {
|
||||
@ -159,6 +160,23 @@ static av_cold int dnxhd_decode_init_thread_copy(AVCodecContext *avctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dnxhd_get_profile(int cid)
|
||||
{
|
||||
switch(cid) {
|
||||
case 1270:
|
||||
return FF_PROFILE_DNXHR_444;
|
||||
case 1271:
|
||||
return FF_PROFILE_DNXHR_HQX;
|
||||
case 1272:
|
||||
return FF_PROFILE_DNXHR_HQ;
|
||||
case 1273:
|
||||
return FF_PROFILE_DNXHR_SQ;
|
||||
case 1274:
|
||||
return FF_PROFILE_DNXHR_LB;
|
||||
}
|
||||
return FF_PROFILE_DNXHD;
|
||||
}
|
||||
|
||||
static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
|
||||
const uint8_t *buf, int buf_size,
|
||||
int first_field)
|
||||
@ -204,6 +222,9 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
|
||||
}
|
||||
|
||||
cid = AV_RB32(buf + 0x28);
|
||||
|
||||
ctx->avctx->profile = dnxhd_get_profile(cid);
|
||||
|
||||
if ((ret = dnxhd_init_vlc(ctx, cid, bitdepth)) < 0)
|
||||
return ret;
|
||||
if (ctx->mbaff && ctx->cid_table->cid != 1260)
|
||||
@ -692,4 +713,5 @@ AVCodec ff_dnxhd_decoder = {
|
||||
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS |
|
||||
AV_CODEC_CAP_SLICE_THREADS,
|
||||
.init_thread_copy = ONLY_IF_THREADS_ENABLED(dnxhd_decode_init_thread_copy),
|
||||
.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
|
||||
};
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "internal.h"
|
||||
#include "mpegvideo.h"
|
||||
#include "pixblockdsp.h"
|
||||
#include "profiles.h"
|
||||
#include "dnxhdenc.h"
|
||||
|
||||
// The largest value that will not lead to overflow for 10-bit samples.
|
||||
@ -1170,4 +1171,5 @@ AVCodec ff_dnxhd_encoder = {
|
||||
},
|
||||
.priv_class = &dnxhd_class,
|
||||
.defaults = dnxhd_defaults,
|
||||
.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
|
||||
};
|
||||
|
@ -46,6 +46,16 @@ const AVProfile ff_dca_profiles[] = {
|
||||
{ FF_PROFILE_UNKNOWN },
|
||||
};
|
||||
|
||||
const AVProfile ff_dnxhd_profiles[] = {
|
||||
{ FF_PROFILE_DNXHD, "DNXHD"},
|
||||
{ FF_PROFILE_DNXHR_LB, "DNXHR LB"},
|
||||
{ FF_PROFILE_DNXHR_SQ, "DNXHR SQ"},
|
||||
{ FF_PROFILE_DNXHR_HQ, "DNXHR HQ" },
|
||||
{ FF_PROFILE_DNXHR_HQX, "DNXHR HQX"},
|
||||
{ FF_PROFILE_DNXHR_444, "DNXHR 444"},
|
||||
{ FF_PROFILE_UNKNOWN },
|
||||
};
|
||||
|
||||
const AVProfile ff_h264_profiles[] = {
|
||||
{ FF_PROFILE_H264_BASELINE, "Baseline" },
|
||||
{ FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" },
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
extern const AVProfile ff_aac_profiles[];
|
||||
extern const AVProfile ff_dca_profiles[];
|
||||
extern const AVProfile ff_dnxhd_profiles[];
|
||||
extern const AVProfile ff_h264_profiles[];
|
||||
extern const AVProfile ff_hevc_profiles[];
|
||||
extern const AVProfile ff_jpeg2000_profiles[];
|
||||
|
Loading…
Reference in New Issue
Block a user