00001 /* 00002 * This file is part of Libav. 00003 * 00004 * Libav is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * Libav is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with Libav; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00017 */ 00018 00019 #ifndef AVCODEC_DV_PROFILE_H 00020 #define AVCODEC_DV_PROFILE_H 00021 00022 #include <stdint.h> 00023 00024 #include "libavutil/pixfmt.h" 00025 #include "libavutil/rational.h" 00026 #include "avcodec.h" 00027 00028 /* minimum number of bytes to read from a DV stream in order to 00029 determine the profile */ 00030 #define DV_PROFILE_BYTES (6*80) /* 6 DIF blocks */ 00031 00032 typedef struct DVwork_chunk { 00033 uint16_t buf_offset; 00034 uint16_t mb_coordinates[5]; 00035 } DVwork_chunk; 00036 00037 /* 00038 * DVprofile is used to express the differences between various 00039 * DV flavors. For now it's primarily used for differentiating 00040 * 525/60 and 625/50, but the plans are to use it for various 00041 * DV specs as well (e.g. SMPTE314M vs. IEC 61834). 00042 */ 00043 typedef struct DVprofile { 00044 int dsf; /* value of the dsf in the DV header */ 00045 int video_stype; /* stype for VAUX source pack */ 00046 int frame_size; /* total size of one frame in bytes */ 00047 int difseg_size; /* number of DIF segments per DIF channel */ 00048 int n_difchan; /* number of DIF channels per frame */ 00049 AVRational time_base; /* 1/framerate */ 00050 int ltc_divisor; /* FPS from the LTS standpoint */ 00051 int height; /* picture height in pixels */ 00052 int width; /* picture width in pixels */ 00053 AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */ 00054 DVwork_chunk *work_chunks; /* each thread gets its own chunk of frame to work on */ 00055 uint32_t *idct_factor; /* set of iDCT factor tables */ 00056 enum PixelFormat pix_fmt; /* picture pixel format */ 00057 int bpm; /* blocks per macroblock */ 00058 const uint8_t *block_sizes; /* AC block sizes, in bits */ 00059 int audio_stride; /* size of audio_shuffle table */ 00060 int audio_min_samples[3]; /* min amount of audio samples */ 00061 /* for 48kHz, 44.1kHz and 32kHz */ 00062 int audio_samples_dist[5]; /* how many samples are supposed to be */ 00063 /* in each frame in a 5 frames window */ 00064 const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */ 00065 } DVprofile; 00066 00067 const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys, 00068 const uint8_t* frame, unsigned buf_size); 00069 const DVprofile* avpriv_dv_frame_profile2(AVCodecContext* codec, const DVprofile *sys, 00070 const uint8_t* frame, unsigned buf_size); 00071 const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec); 00072 00076 void ff_dv_print_profiles(void *logctx, int loglevel); 00077 00078 #endif /* AVCODEC_DV_PROFILE_H */