mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Merge commit 'f6ee61fb05482c617f5deee29a190d8ff483b3d1'
* commit 'f6ee61fb05482c617f5deee29a190d8ff483b3d1': lavc: export DV profile API used by muxer/demuxer as public Conflicts: configure doc/APIchanges libavcodec/Makefile libavcodec/dv_profile.c libavcodec/dv_profile.h libavcodec/version.h libavformat/dvenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
1b58f13761
7
configure
vendored
7
configure
vendored
@ -1801,6 +1801,7 @@ CONFIG_EXTRA="
|
|||||||
bswapdsp
|
bswapdsp
|
||||||
cabac
|
cabac
|
||||||
dsputil
|
dsputil
|
||||||
|
dvprofile
|
||||||
exif
|
exif
|
||||||
fdctdsp
|
fdctdsp
|
||||||
frame_thread_encoder
|
frame_thread_encoder
|
||||||
@ -2045,8 +2046,8 @@ dca_decoder_select="mdct"
|
|||||||
dirac_decoder_select="dsputil dwt golomb videodsp"
|
dirac_decoder_select="dsputil dwt golomb videodsp"
|
||||||
dnxhd_decoder_select="blockdsp idctdsp"
|
dnxhd_decoder_select="blockdsp idctdsp"
|
||||||
dnxhd_encoder_select="aandcttables blockdsp dsputil fdctdsp idctdsp mpegvideoenc"
|
dnxhd_encoder_select="aandcttables blockdsp dsputil fdctdsp idctdsp mpegvideoenc"
|
||||||
dvvideo_decoder_select="idctdsp"
|
dvvideo_decoder_select="dvprofile idctdsp"
|
||||||
dvvideo_encoder_select="dsputil fdctdsp"
|
dvvideo_encoder_select="dsputil dvprofile fdctdsp"
|
||||||
dxa_decoder_select="zlib"
|
dxa_decoder_select="zlib"
|
||||||
eac3_decoder_select="ac3_decoder"
|
eac3_decoder_select="ac3_decoder"
|
||||||
eac3_encoder_select="ac3_encoder"
|
eac3_encoder_select="ac3_encoder"
|
||||||
@ -2355,6 +2356,8 @@ caf_demuxer_select="riffdec"
|
|||||||
dirac_demuxer_select="dirac_parser"
|
dirac_demuxer_select="dirac_parser"
|
||||||
dts_demuxer_select="dca_parser"
|
dts_demuxer_select="dca_parser"
|
||||||
dtshd_demuxer_select="dca_parser"
|
dtshd_demuxer_select="dca_parser"
|
||||||
|
dv_demuxer_select="dvprofile"
|
||||||
|
dv_muxer_select="dvprofile"
|
||||||
dxa_demuxer_select="riffdec"
|
dxa_demuxer_select="riffdec"
|
||||||
eac3_demuxer_select="ac3_parser"
|
eac3_demuxer_select="ac3_parser"
|
||||||
f4v_muxer_select="mov_muxer"
|
f4v_muxer_select="mov_muxer"
|
||||||
|
@ -15,6 +15,9 @@ libavutil: 2012-10-22
|
|||||||
|
|
||||||
API changes, most recent first:
|
API changes, most recent first:
|
||||||
|
|
||||||
|
2014-07-xx - xxxxxxx - lavc 55.56.0 - dv_profile.h
|
||||||
|
Add a public API for DV profile handling.
|
||||||
|
|
||||||
2014-06-20 - 0dceefc / 9e500ef - lavu 52.90.100 / 53.17.0 - imgutils.h
|
2014-06-20 - 0dceefc / 9e500ef - lavu 52.90.100 / 53.17.0 - imgutils.h
|
||||||
Add av_image_check_sar().
|
Add av_image_check_sar().
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ NAME = avcodec
|
|||||||
|
|
||||||
HEADERS = avcodec.h \
|
HEADERS = avcodec.h \
|
||||||
avfft.h \
|
avfft.h \
|
||||||
|
dv_profile.h \
|
||||||
dxva2.h \
|
dxva2.h \
|
||||||
old_codec_ids.h \
|
old_codec_ids.h \
|
||||||
vaapi.h \
|
vaapi.h \
|
||||||
@ -19,6 +20,7 @@ OBJS = allcodecs.o \
|
|||||||
bitstream.o \
|
bitstream.o \
|
||||||
bitstream_filter.o \
|
bitstream_filter.o \
|
||||||
codec_desc.o \
|
codec_desc.o \
|
||||||
|
dv_profile.o \
|
||||||
fmtconvert.o \
|
fmtconvert.o \
|
||||||
imgconvert.o \
|
imgconvert.o \
|
||||||
mathtables.o \
|
mathtables.o \
|
||||||
@ -200,8 +202,8 @@ OBJS-$(CONFIG_DVBSUB_DECODER) += dvbsubdec.o
|
|||||||
OBJS-$(CONFIG_DVBSUB_ENCODER) += dvbsub.o
|
OBJS-$(CONFIG_DVBSUB_ENCODER) += dvbsub.o
|
||||||
OBJS-$(CONFIG_DVDSUB_DECODER) += dvdsubdec.o
|
OBJS-$(CONFIG_DVDSUB_DECODER) += dvdsubdec.o
|
||||||
OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
|
OBJS-$(CONFIG_DVDSUB_ENCODER) += dvdsubenc.o
|
||||||
OBJS-$(CONFIG_DVVIDEO_DECODER) += dvdec.o dv.o dvdata.o dv_profile.o
|
OBJS-$(CONFIG_DVVIDEO_DECODER) += dvdec.o dv.o dvdata.o
|
||||||
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dvenc.o dv.o dvdata.o dv_profile.o
|
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dvenc.o dv.o dvdata.o
|
||||||
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
|
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
|
||||||
OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o
|
OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o
|
||||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3_data.o
|
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3_data.o
|
||||||
@ -667,8 +669,6 @@ OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
|
|||||||
OBJS-$(CONFIG_ADX_DEMUXER) += adx.o
|
OBJS-$(CONFIG_ADX_DEMUXER) += adx.o
|
||||||
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o \
|
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o \
|
||||||
ac3tab.o
|
ac3tab.o
|
||||||
OBJS-$(CONFIG_DV_DEMUXER) += dv_profile.o
|
|
||||||
OBJS-$(CONFIG_DV_MUXER) += dv_profile.o
|
|
||||||
OBJS-$(CONFIG_FLAC_DEMUXER) += flac.o flacdata.o vorbis_data.o \
|
OBJS-$(CONFIG_FLAC_DEMUXER) += flac.o flacdata.o vorbis_data.o \
|
||||||
vorbis_parser.o xiph.o
|
vorbis_parser.o xiph.o
|
||||||
OBJS-$(CONFIG_FLAC_MUXER) += flac.o flacdata.o vorbis_data.o
|
OBJS-$(CONFIG_FLAC_MUXER) += flac.o flacdata.o vorbis_data.o
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
/* XXX: also include quantization */
|
/* XXX: also include quantization */
|
||||||
RL_VLC_ELEM ff_dv_rl_vlc[1184];
|
RL_VLC_ELEM ff_dv_rl_vlc[1184];
|
||||||
|
|
||||||
static inline void dv_calc_mb_coordinates(const DVprofile *d, int chan, int seq, int slot,
|
static inline void dv_calc_mb_coordinates(const AVDVProfile *d, int chan, int seq, int slot,
|
||||||
uint16_t *tbl)
|
uint16_t *tbl)
|
||||||
{
|
{
|
||||||
static const uint8_t off[] = { 2, 6, 8, 0, 4 };
|
static const uint8_t off[] = { 2, 6, 8, 0, 4 };
|
||||||
@ -175,7 +175,7 @@ static const uint8_t dv100_qstep[16] = {
|
|||||||
|
|
||||||
static const uint8_t dv_quant_areas[4] = { 6, 21, 43, 64 };
|
static const uint8_t dv_quant_areas[4] = { 6, 21, 43, 64 };
|
||||||
|
|
||||||
int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const DVprofile *d)
|
int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const AVDVProfile *d)
|
||||||
{
|
{
|
||||||
int j,i,c,s,p;
|
int j,i,c,s,p;
|
||||||
uint32_t *factor1, *factor2;
|
uint32_t *factor1, *factor2;
|
||||||
|
@ -38,7 +38,7 @@ typedef struct DVwork_chunk {
|
|||||||
} DVwork_chunk;
|
} DVwork_chunk;
|
||||||
|
|
||||||
typedef struct DVVideoContext {
|
typedef struct DVVideoContext {
|
||||||
const DVprofile *sys;
|
const AVDVProfile *sys;
|
||||||
AVFrame *frame;
|
AVFrame *frame;
|
||||||
AVCodecContext *avctx;
|
AVCodecContext *avctx;
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
@ -95,10 +95,10 @@ enum dv_pack_type {
|
|||||||
|
|
||||||
extern RL_VLC_ELEM ff_dv_rl_vlc[1184];
|
extern RL_VLC_ELEM ff_dv_rl_vlc[1184];
|
||||||
|
|
||||||
int ff_dv_init_dynamic_tables(DVVideoContext *s, const DVprofile *d);
|
int ff_dv_init_dynamic_tables(DVVideoContext *s, const AVDVProfile *d);
|
||||||
int ff_dvvideo_init(AVCodecContext *avctx);
|
int ff_dvvideo_init(AVCodecContext *avctx);
|
||||||
|
|
||||||
static inline int dv_work_pool_size(const DVprofile *d)
|
static inline int dv_work_pool_size(const AVDVProfile *d)
|
||||||
{
|
{
|
||||||
int size = d->n_difchan*d->difseg_size*27;
|
int size = d->n_difchan*d->difseg_size*27;
|
||||||
if (DV_PROFILE_IS_1080i50(d))
|
if (DV_PROFILE_IS_1080i50(d))
|
||||||
|
@ -18,12 +18,17 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "libavutil/common.h"
|
#include "libavutil/common.h"
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "libavutil/log.h"
|
#include "libavutil/log.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "dv_profile.h"
|
#include "dv_profile.h"
|
||||||
|
#include "dv_profile_internal.h"
|
||||||
|
|
||||||
|
#if CONFIG_DVPROFILE
|
||||||
|
|
||||||
static const uint8_t dv_audio_shuffle525[10][9] = {
|
static const uint8_t dv_audio_shuffle525[10][9] = {
|
||||||
{ 0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */
|
{ 0, 30, 60, 20, 50, 80, 10, 40, 70 }, /* 1st channel */
|
||||||
@ -64,7 +69,7 @@ static const uint8_t block_sizes_dv100[8] = {
|
|||||||
80, 80, 80, 80, 80, 80, 64, 64,
|
80, 80, 80, 80, 80, 80, 64, 64,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const DVprofile dv_profiles[] = {
|
static const AVDVProfile dv_profiles[] = {
|
||||||
{ .dsf = 0,
|
{ .dsf = 0,
|
||||||
.video_stype = 0x0,
|
.video_stype = 0x0,
|
||||||
.frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */
|
.frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */
|
||||||
@ -247,9 +252,23 @@ static const DVprofile dv_profiles[] = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const DVprofile* avpriv_dv_frame_profile2(AVCodecContext* codec, const DVprofile *sys,
|
void ff_dv_print_profiles(void *logctx, int loglevel)
|
||||||
const uint8_t* frame, unsigned buf_size)
|
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++) {
|
||||||
|
const AVDVProfile *p = &dv_profiles[i];
|
||||||
|
av_log(logctx, loglevel, "Frame size: %dx%d; pixel format: %s, "
|
||||||
|
"framerate: %d/%d\n", p->width, p->height, av_get_pix_fmt_name(p->pix_fmt),
|
||||||
|
p->time_base.den, p->time_base.num);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_DVPROFILE */
|
||||||
|
|
||||||
|
const AVDVProfile* avpriv_dv_frame_profile2(AVCodecContext* codec, const AVDVProfile *sys,
|
||||||
|
const uint8_t* frame, unsigned buf_size)
|
||||||
|
{
|
||||||
|
#if CONFIG_DVPROFILE
|
||||||
int i, dsf, stype;
|
int i, dsf, stype;
|
||||||
|
|
||||||
if(buf_size < DV_PROFILE_BYTES)
|
if(buf_size < DV_PROFILE_BYTES)
|
||||||
@ -278,6 +297,7 @@ const DVprofile* avpriv_dv_frame_profile2(AVCodecContext* codec, const DVprofile
|
|||||||
/* check if old sys matches and assumes corrupted input */
|
/* check if old sys matches and assumes corrupted input */
|
||||||
if (sys && buf_size == sys->frame_size)
|
if (sys && buf_size == sys->frame_size)
|
||||||
return sys;
|
return sys;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* hack for trac issue #217, dv files created with QuickTime 3 */
|
/* hack for trac issue #217, dv files created with QuickTime 3 */
|
||||||
if ((frame[3] & 0x7f) == 0x3f && frame[80 * 5 + 48 + 3] == 0xff)
|
if ((frame[3] & 0x7f) == 0x3f && frame[80 * 5 + 48 + 3] == 0xff)
|
||||||
@ -286,41 +306,40 @@ const DVprofile* avpriv_dv_frame_profile2(AVCodecContext* codec, const DVprofile
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys,
|
const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys,
|
||||||
const uint8_t* frame, unsigned buf_size)
|
const uint8_t* frame, unsigned buf_size)
|
||||||
{
|
{
|
||||||
return avpriv_dv_frame_profile2(NULL, sys, frame, buf_size);
|
return avpriv_dv_frame_profile2(NULL, sys, frame, buf_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec)
|
const AVDVProfile *av_dv_codec_profile(int width, int height,
|
||||||
|
enum AVPixelFormat pix_fmt)
|
||||||
{
|
{
|
||||||
|
#if CONFIG_DVPROFILE
|
||||||
int i;
|
int i;
|
||||||
int w, h;
|
|
||||||
|
|
||||||
if (codec->coded_width || codec->coded_height) {
|
|
||||||
w = codec->coded_width;
|
|
||||||
h = codec->coded_height;
|
|
||||||
} else {
|
|
||||||
w = codec->width;
|
|
||||||
h = codec->height;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)
|
for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)
|
||||||
if (h == dv_profiles[i].height &&
|
if (height == dv_profiles[i].height &&
|
||||||
codec->pix_fmt == dv_profiles[i].pix_fmt &&
|
pix_fmt == dv_profiles[i].pix_fmt &&
|
||||||
w == dv_profiles[i].width)
|
width == dv_profiles[i].width)
|
||||||
return &dv_profiles[i];
|
return &dv_profiles[i];
|
||||||
|
#endif
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_dv_print_profiles(void *logctx, int loglevel)
|
#if LIBAVCODEC_VERSION_MAJOR < 56
|
||||||
|
const AVDVProfile *avpriv_dv_frame_profile(const AVDVProfile *sys,
|
||||||
|
const uint8_t* frame, unsigned buf_size)
|
||||||
{
|
{
|
||||||
int i;
|
return av_dv_frame_profile(sys, frame, buf_size);
|
||||||
for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++) {
|
|
||||||
const DVprofile *p = &dv_profiles[i];
|
|
||||||
av_log(logctx, loglevel, "Frame size: %dx%d; pixel format: %s, "
|
|
||||||
"framerate: %d/%d\n", p->width, p->height, av_get_pix_fmt_name(p->pix_fmt),
|
|
||||||
p->time_base.den, p->time_base.num);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const AVDVProfile *avpriv_dv_codec_profile(AVCodecContext *codec)
|
||||||
|
{
|
||||||
|
if (codec->coded_width || codec->coded_height) {
|
||||||
|
return av_dv_codec_profile(codec->coded_width, codec->coded_height, codec->pix_fmt);
|
||||||
|
} else
|
||||||
|
return av_dv_codec_profile(codec->width, codec->height, codec->pix_fmt);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -30,12 +30,12 @@
|
|||||||
#define DV_PROFILE_BYTES (6*80) /* 6 DIF blocks */
|
#define DV_PROFILE_BYTES (6*80) /* 6 DIF blocks */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DVprofile is used to express the differences between various
|
* AVDVProfile is used to express the differences between various
|
||||||
* DV flavors. For now it's primarily used for differentiating
|
* DV flavors. For now it's primarily used for differentiating
|
||||||
* 525/60 and 625/50, but the plans are to use it for various
|
* 525/60 and 625/50, but the plans are to use it for various
|
||||||
* DV specs as well (e.g. SMPTE314M vs. IEC 61834).
|
* DV specs as well (e.g. SMPTE314M vs. IEC 61834).
|
||||||
*/
|
*/
|
||||||
typedef struct DVprofile {
|
typedef struct AVDVProfile {
|
||||||
int dsf; /* value of the dsf in the DV header */
|
int dsf; /* value of the dsf in the DV header */
|
||||||
int video_stype; /* stype for VAUX source pack */
|
int video_stype; /* stype for VAUX source pack */
|
||||||
int frame_size; /* total size of one frame in bytes */
|
int frame_size; /* total size of one frame in bytes */
|
||||||
@ -55,17 +55,30 @@ typedef struct DVprofile {
|
|||||||
int audio_samples_dist[5]; /* how many samples are supposed to be */
|
int audio_samples_dist[5]; /* how many samples are supposed to be */
|
||||||
/* in each frame in a 5 frames window */
|
/* in each frame in a 5 frames window */
|
||||||
const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */
|
const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */
|
||||||
} DVprofile;
|
} AVDVProfile;
|
||||||
|
|
||||||
const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys,
|
const AVDVProfile* avpriv_dv_frame_profile2(AVCodecContext* codec, const AVDVProfile *sys,
|
||||||
const uint8_t* frame, unsigned buf_size);
|
const uint8_t* frame, unsigned buf_size);
|
||||||
const DVprofile* avpriv_dv_frame_profile2(AVCodecContext* codec, const DVprofile *sys,
|
#if LIBAVCODEC_VERSION_MAJOR < 56
|
||||||
const uint8_t* frame, unsigned buf_size);
|
const AVDVProfile *avpriv_dv_frame_profile(const AVDVProfile *sys,
|
||||||
const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec);
|
const uint8_t* frame, unsigned buf_size);
|
||||||
|
const AVDVProfile *avpriv_dv_codec_profile(AVCodecContext* codec);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print all allowed DV profiles into logctx at specified logging level.
|
* Get a DV profile for the provided compressed frame.
|
||||||
|
*
|
||||||
|
* @param sys the profile used for the previous frame, may be NULL
|
||||||
|
* @param frame the compressed data buffer
|
||||||
|
* @param buf_size size of the buffer in bytes
|
||||||
|
* @return the DV profile for the supplied data or NULL on failure
|
||||||
*/
|
*/
|
||||||
void ff_dv_print_profiles(void *logctx, int loglevel);
|
const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys,
|
||||||
|
const uint8_t *frame, unsigned buf_size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a DV profile for the provided stream parameters.
|
||||||
|
*/
|
||||||
|
const AVDVProfile *av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt);
|
||||||
|
|
||||||
#endif /* AVCODEC_DV_PROFILE_H */
|
#endif /* AVCODEC_DV_PROFILE_H */
|
||||||
|
27
libavcodec/dv_profile_internal.h
Normal file
27
libavcodec/dv_profile_internal.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of FFmpeg.
|
||||||
|
*
|
||||||
|
* FFmpeg is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* FFmpeg is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with FFmpeg; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef AVCODEC_DV_PROFILE_INTERNAL_H
|
||||||
|
#define AVCODEC_DV_PROFILE_INTERNAL_H
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print all allowed DV profiles into logctx at specified logging level.
|
||||||
|
*/
|
||||||
|
void ff_dv_print_profiles(void *logctx, int loglevel);
|
||||||
|
|
||||||
|
#endif /* AVCODEC_DV_PROFILE_INTERNAL_H */
|
@ -349,7 +349,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
|
|||||||
DVVideoContext *s = avctx->priv_data;
|
DVVideoContext *s = avctx->priv_data;
|
||||||
const uint8_t* vsc_pack;
|
const uint8_t* vsc_pack;
|
||||||
int apt, is16_9, ret;
|
int apt, is16_9, ret;
|
||||||
const DVprofile *sys;
|
const AVDVProfile *sys;
|
||||||
|
|
||||||
sys = avpriv_dv_frame_profile2(avctx, s->sys, buf, buf_size);
|
sys = avpriv_dv_frame_profile2(avctx, s->sys, buf, buf_size);
|
||||||
if (!sys || buf_size < sys->frame_size) {
|
if (!sys || buf_size < sys->frame_size) {
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "put_bits.h"
|
#include "put_bits.h"
|
||||||
#include "dv.h"
|
#include "dv.h"
|
||||||
#include "dv_tablegen.h"
|
#include "dv_tablegen.h"
|
||||||
|
#include "dv_profile_internal.h"
|
||||||
|
|
||||||
static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
|
static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
#include "libavutil/version.h"
|
#include "libavutil/version.h"
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 55
|
#define LIBAVCODEC_VERSION_MAJOR 55
|
||||||
#define LIBAVCODEC_VERSION_MINOR 68
|
#define LIBAVCODEC_VERSION_MINOR 69
|
||||||
#define LIBAVCODEC_VERSION_MICRO 102
|
#define LIBAVCODEC_VERSION_MICRO 100
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
LIBAVCODEC_VERSION_MINOR, \
|
LIBAVCODEC_VERSION_MINOR, \
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
|
|
||||||
struct DVDemuxContext {
|
struct DVDemuxContext {
|
||||||
const DVprofile* sys; /* Current DV profile. E.g.: 525/60, 625/50 */
|
const AVDVProfile* sys; /* Current DV profile. E.g.: 525/60, 625/50 */
|
||||||
AVFormatContext* fctx;
|
AVFormatContext* fctx;
|
||||||
AVStream* vst;
|
AVStream* vst;
|
||||||
AVStream* ast[4];
|
AVStream* ast[4];
|
||||||
@ -114,7 +114,7 @@ static const int dv_audio_frequency[3] = {
|
|||||||
* are converted into 16bit linear ones.
|
* are converted into 16bit linear ones.
|
||||||
*/
|
*/
|
||||||
static int dv_extract_audio(uint8_t *frame, uint8_t **ppcm,
|
static int dv_extract_audio(uint8_t *frame, uint8_t **ppcm,
|
||||||
const DVprofile *sys)
|
const AVDVProfile *sys)
|
||||||
{
|
{
|
||||||
int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
|
int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
|
||||||
uint16_t lc, rc;
|
uint16_t lc, rc;
|
||||||
@ -369,7 +369,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
|
|||||||
uint8_t *ppcm[5] = { 0 };
|
uint8_t *ppcm[5] = { 0 };
|
||||||
|
|
||||||
if (buf_size < DV_PROFILE_BYTES ||
|
if (buf_size < DV_PROFILE_BYTES ||
|
||||||
!(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
|
!(c->sys = av_dv_frame_profile(c->sys, buf, buf_size)) ||
|
||||||
buf_size < c->sys->frame_size) {
|
buf_size < c->sys->frame_size) {
|
||||||
return -1; /* Broken frame, or not enough data */
|
return -1; /* Broken frame, or not enough data */
|
||||||
}
|
}
|
||||||
@ -419,7 +419,8 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
|
|||||||
int64_t timestamp, int flags)
|
int64_t timestamp, int flags)
|
||||||
{
|
{
|
||||||
// FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
|
// FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
|
||||||
const DVprofile *sys = avpriv_dv_codec_profile(c->vst->codec);
|
const AVDVProfile *sys = av_dv_codec_profile(c->vst->codec->width, c->vst->codec->height,
|
||||||
|
c->vst->codec->pix_fmt);
|
||||||
int64_t offset;
|
int64_t offset;
|
||||||
int64_t size = avio_size(s->pb) - s->data_offset;
|
int64_t size = avio_size(s->pb) - s->data_offset;
|
||||||
int64_t max_offset = ((size - 1) / sys->frame_size) * sys->frame_size;
|
int64_t max_offset = ((size - 1) / sys->frame_size) * sys->frame_size;
|
||||||
@ -519,9 +520,9 @@ static int dv_read_header(AVFormatContext *s)
|
|||||||
avio_seek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
|
avio_seek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
|
||||||
c->dv_demux->sys = avpriv_dv_frame_profile(c->dv_demux->sys,
|
c->dv_demux->sys = av_dv_frame_profile(c->dv_demux->sys,
|
||||||
c->buf,
|
c->buf,
|
||||||
DV_PROFILE_BYTES);
|
DV_PROFILE_BYTES);
|
||||||
if (!c->dv_demux->sys) {
|
if (!c->dv_demux->sys) {
|
||||||
av_log(s, AV_LOG_ERROR,
|
av_log(s, AV_LOG_ERROR,
|
||||||
"Can't determine profile of DV input stream.\n");
|
"Can't determine profile of DV input stream.\n");
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
struct DVMuxContext {
|
struct DVMuxContext {
|
||||||
AVClass *av_class;
|
AVClass *av_class;
|
||||||
const DVprofile* sys; /* current DV profile, e.g.: 525/60, 625/50 */
|
const AVDVProfile* sys; /* current DV profile, e.g.: 525/60, 625/50 */
|
||||||
int n_ast; /* number of stereo audio streams (up to 2) */
|
int n_ast; /* number of stereo audio streams (up to 2) */
|
||||||
AVStream *ast[2]; /* stereo audio streams */
|
AVStream *ast[2]; /* stereo audio streams */
|
||||||
AVFifoBuffer *audio_data[2]; /* FIFO for storing excessive amounts of PCM */
|
AVFifoBuffer *audio_data[2]; /* FIFO for storing excessive amounts of PCM */
|
||||||
@ -72,7 +72,7 @@ static const int dv_aaux_packs_dist[12][9] = {
|
|||||||
{ 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
|
{ 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
|
||||||
};
|
};
|
||||||
|
|
||||||
static int dv_audio_frame_size(const DVprofile* sys, int frame)
|
static int dv_audio_frame_size(const AVDVProfile* sys, int frame)
|
||||||
{
|
{
|
||||||
return sys->audio_samples_dist[frame % (sizeof(sys->audio_samples_dist) /
|
return sys->audio_samples_dist[frame % (sizeof(sys->audio_samples_dist) /
|
||||||
sizeof(sys->audio_samples_dist[0]))];
|
sizeof(sys->audio_samples_dist[0]))];
|
||||||
@ -314,7 +314,7 @@ static DVMuxContext* dv_init_mux(AVFormatContext* s)
|
|||||||
c->ast[i]->codec->channels != 2))
|
c->ast[i]->codec->channels != 2))
|
||||||
goto bail_out;
|
goto bail_out;
|
||||||
}
|
}
|
||||||
c->sys = avpriv_dv_codec_profile(vst->codec);
|
c->sys = av_dv_codec_profile(vst->codec->width, vst->codec->height, vst->codec->pix_fmt);
|
||||||
if (!c->sys)
|
if (!c->sys)
|
||||||
goto bail_out;
|
goto bail_out;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user