Path: blob/master/dep/ffmpeg/include/libavcodec/dv_profile.h
4216 views
/*1* This file is part of FFmpeg.2*3* FFmpeg is free software; you can redistribute it and/or4* modify it under the terms of the GNU Lesser General Public5* License as published by the Free Software Foundation; either6* version 2.1 of the License, or (at your option) any later version.7*8* FFmpeg is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU11* Lesser General Public License for more details.12*13* You should have received a copy of the GNU Lesser General Public14* License along with FFmpeg; if not, write to the Free Software15* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA16*/1718#ifndef AVCODEC_DV_PROFILE_H19#define AVCODEC_DV_PROFILE_H2021#include <stdint.h>2223#include "libavutil/pixfmt.h"24#include "libavutil/rational.h"2526/* minimum number of bytes to read from a DV stream in order to27* determine the profile */28#define DV_PROFILE_BYTES (6 * 80) /* 6 DIF blocks */293031/*32* AVDVProfile is used to express the differences between various33* DV flavors. For now it's primarily used for differentiating34* 525/60 and 625/50, but the plans are to use it for various35* DV specs as well (e.g. SMPTE314M vs. IEC 61834).36*/37typedef struct AVDVProfile {38int dsf; /* value of the dsf in the DV header */39int video_stype; /* stype for VAUX source pack */40int frame_size; /* total size of one frame in bytes */41int difseg_size; /* number of DIF segments per DIF channel */42int n_difchan; /* number of DIF channels per frame */43AVRational time_base; /* 1/framerate */44int ltc_divisor; /* FPS from the LTS standpoint */45int height; /* picture height in pixels */46int width; /* picture width in pixels */47AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */48enum AVPixelFormat pix_fmt; /* picture pixel format */49int bpm; /* blocks per macroblock */50const uint8_t *block_sizes; /* AC block sizes, in bits */51int audio_stride; /* size of audio_shuffle table */52int audio_min_samples[3]; /* min amount of audio samples */53/* for 48kHz, 44.1kHz and 32kHz */54int audio_samples_dist[5]; /* how many samples are supposed to be */55/* in each frame in a 5 frames window */56const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */57} AVDVProfile;5859/**60* Get a DV profile for the provided compressed frame.61*62* @param sys the profile used for the previous frame, may be NULL63* @param frame the compressed data buffer64* @param buf_size size of the buffer in bytes65* @return the DV profile for the supplied data or NULL on failure66*/67const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys,68const uint8_t *frame, unsigned buf_size);6970/**71* Get a DV profile for the provided stream parameters.72*/73const AVDVProfile *av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt);7475/**76* Get a DV profile for the provided stream parameters.77* The frame rate is used as a best-effort parameter.78*/79const AVDVProfile *av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate);8081#endif /* AVCODEC_DV_PROFILE_H */828384