Newer
Older
*/
int inter_threshold;
/**
* CODEC_FLAG2_*
* - encoding: Set by user.
* - decoding: Set by user.
* Simulates errors in the bitstream to test error concealment.
* - encoding: Set by user.
* - decoding: unused
Michael Niedermayer
committed
/**
* MP3 antialias algorithm, see FF_AA_* below.
* - encoding: unused
Michael Niedermayer
committed
*/
int antialias_algo;
#define FF_AA_AUTO 0
#define FF_AA_FASTINT 1 //not implemented yet
#define FF_AA_INT 2
#define FF_AA_FLOAT 3
* quantizer noise shaping
* - encoding: Set by user.
* - decoding: unused
*/
int quantizer_noise_shaping;
* is used to decide how many independent tasks should be passed to execute()
* - encoding: Set by user.
* - decoding: Set by user.
* The codec may call this to execute several independent things.
* It will return only after finishing all tasks.
* The user may replace this with some multithreaded implementation,
* the default implementation will execute the parts serially.
* @param count the number of things to execute
* - encoding: Set by libavcodec, user can override.
* - decoding: Set by libavcodec, user can override.
Roman Shaposhnik
committed
int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
* thread opaque
* Can be used by execute() to store some per AVCodecContext stuff.
* - encoding: set by execute()
* - decoding: set by execute()
*/
void *thread_opaque;
Michael Niedermayer
committed
/**
* Motion estimation threshold below which no motion estimation is
* performed, but instead the user specified motion vectors are used.
Michael Niedermayer
committed
* - decoding: unused
Michael Niedermayer
committed
*/
Michael Niedermayer
committed
/**
* Macroblock threshold below which the user specified macroblock types will be used.
* - encoding: Set by user.
Michael Niedermayer
committed
* - decoding: unused
*/
int mb_threshold;
* precision of the intra DC coefficient - 8
* - encoding: Set by user.
* - decoding: unused
*/
int intra_dc_precision;
* noise vs. sse weight for the nsse comparsion function
* - encoding: Set by user.
* Number of macroblock rows at the top which are skipped.
*/
int skip_top;
/**
* Number of macroblock rows at the bottom which are skipped.
*/
int skip_bottom;
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
int profile;
#define FF_PROFILE_UNKNOWN -99
#define FF_PROFILE_AAC_MAIN 0
#define FF_PROFILE_AAC_LOW 1
#define FF_PROFILE_AAC_SSR 2
#define FF_PROFILE_AAC_LTP 3
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
int level;
#define FF_LEVEL_UNKNOWN -99
* low resolution decoding, 1-> 1/2 size, 2->1/4 size
* Bitstream width / height, may be different from width/height if lowres
* or other things are used.
* - decoding: Set by user before init if known. Codec should override / dynamically change if needed.
*/
int coded_width, coded_height;
* - decoding: unused
*/
int frame_skip_threshold;
/**
* frame skip factor
* - decoding: unused
*/
int frame_skip_factor;
/**
* frame skip exponent
* - decoding: unused
*/
int frame_skip_exp;
/**
* frame skip comparison function
* - encoding: Set by user.
* - decoding: unused
*/
int frame_skip_cmp;
Christophe Massiot
committed
/**
* Border processing masking, raises the quantizer for mbs on the borders
Christophe Massiot
committed
* of the picture.
Christophe Massiot
committed
* - decoding: unused
*/
float border_masking;
Michael Niedermayer
committed
/**
* minimum MB lagrange multipler
* - encoding: Set by user.
Michael Niedermayer
committed
* - decoding: unused
*/
int mb_lmin;
/**
* maximum MB lagrange multipler
* - encoding: Set by user.
Michael Niedermayer
committed
* - decoding: unused
*/
int mb_lmax;
* - decoding: unused
*/
int me_penalty_compensation;
* - decoding: unused
*/
int bidir_refine;
/**
*
* - decoding: unused
*/
int brd_scale;
/**
* constant rate factor - quality-based VBR - values ~correspond to qps
/**
* constant quantization parameter rate control method
* - decoding: unused
*/
int cqp;
/**
* minimum GOP size
* - encoding: Set by user.
* - decoding: unused
*/
int keyint_min;
/**
* number of reference frames
* - decoding: Set by lavc.
*/
int refs;
/**
* chroma qp offset from luma
* - decoding: unused
*/
int chromaoffset;
/**
* Influences how often B-frames are used.
* - encoding: Set by user.
* - decoding: unused
*/
int bframebias;
/**
* trellis RD quantization
* - decoding: unused
*/
int trellis;
/**
* Reduce fluctuations in qp (before curve compression).
* - encoding: Set by user.
* - decoding: unused
*/
float complexityblur;
/**
* in-loop deblocking filter alphac0 parameter
* alpha is in the range -6...6
* - decoding: unused
*/
int deblockalpha;
/**
* in-loop deblocking filter beta parameter
* beta is in the range -6...6
* - decoding: unused
*/
int deblockbeta;
/**
* macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4
#define X264_PART_I4X4 0x001 /* Analyze i4x4 */
#define X264_PART_I8X8 0x002 /* Analyze i8x8 (requires 8x8 transform) */
#define X264_PART_P8X8 0x010 /* Analyze p16x8, p8x16 and p8x8 */
#define X264_PART_P4X4 0x020 /* Analyze p8x4, p4x8, p4x4 */
#define X264_PART_B8X8 0x100 /* Analyze b16x8, b8x16 and b8x8 */
* direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)
/**
* Audio cutoff bandwidth (0 means "automatic")
* - decoding: unused
*/
int cutoff;
* Multiplied by qscale for each frame and added to scene_change_score.
* - encoding: Set by user.
* - decoding: unused
*/
int scenechange_factor;
* Note: Value depends upon the compare function used for fullpel ME.
* - encoding: Set by user.
* - decoding: unused
*/
int mv0_threshold;
/**
* Adjusts sensitivity of b_frame_strategy 1.
* - encoding: Set by user.
* - decoding: unused
*/
int b_sensitivity;
* - decoding: unused
*/
int compression_level;
#define FF_COMPRESSION_DEFAULT -1
/**
* Sets whether to use LPC mode - used by FLAC encoder.
* - encoding: Set by user.
* - decoding: unused
*/
int use_lpc;
/**
* LPC coefficient precision - used by FLAC encoder
* - encoding: Set by user.
* - decoding: unused
*/
int lpc_coeff_precision;
/**
* - encoding: Set by user.
* - decoding: unused
*/
int min_prediction_order;
/**
* - encoding: Set by user.
* - decoding: unused
*/
int max_prediction_order;
/**
* search method for selecting prediction order
* - encoding: Set by user.
* - decoding: unused
*/
int prediction_order_method;
/**
* - encoding: Set by user.
* - decoding: unused
*/
int min_partition_order;
/**
* - encoding: Set by user.
* - decoding: unused
*/
int max_partition_order;
Baptiste Coudurier
committed
/**
* GOP timecode frame start number, in non drop frame format
* - encoding: Set by user.
* - decoding: unused
Baptiste Coudurier
committed
*/
int64_t timecode_frame_start;
#if LIBAVCODEC_VERSION_MAJOR < 53
/**
* Decoder should decode to this many channels if it can (0 for default)
* - encoding: unused
* - decoding: Set by user.
* @deprecated Deprecated in favor of request_channel_layout.
*/
int request_channels;
Justin Ruggles
committed
/**
* Percentage of dynamic range compression to be applied by the decoder.
* The default value is 1.0, corresponding to full compression.
* - encoding: unused
* - decoding: Set by user.
*/
float drc_scale;
/**
* opaque 64bit number (generally a PTS) that will be reordered and
* output in AVFrame.reordered_opaque
* - encoding: unused
* - decoding: Set by user.
*/
int64_t reordered_opaque;
/**
* Bits per sample/pixel of internal libavcodec pixel/sample format.
* This field is applicable only when sample_fmt is SAMPLE_FMT_S32.
* - encoding: set by user.
* - decoding: set by libavcodec.
*/
int bits_per_raw_sample;
/**
* Audio channel layout.
* - encoding: set by user.
* - decoding: set by libavcodec.
*/
int64_t channel_layout;
/**
* Request decoder to use this channel layout if it can (0 for default)
* - encoding: unused
* - decoding: Set by user.
*/
int64_t request_channel_layout;
/**
* Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
* - encoding: Set by user.
* - decoding: unused.
*/
float rc_max_available_vbv_use;
/**
* Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
* - encoding: Set by user.
* - decoding: unused.
*/
float rc_min_vbv_overflow_use;
/**
* Hardware accelerator in use
* - encoding: unused.
* - decoding: Set by libavcodec
*/
struct AVHWAccel *hwaccel;
/**
* For some codecs, the time base is closer to the field rate than the frame rate.
* Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
* if no telecine is used ...
*
* Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
*/
int ticks_per_frame;
/**
* Hardware accelerator context.
* For some hardware accelerators, a global context needs to be
* provided by the user. In that case, this holds display-dependent
* data FFmpeg cannot instantiate itself. Please refer to the
* FFmpeg HW accelerator documentation to know how to fill this
* is. e.g. for VA API, this is a struct vaapi_context.
* - encoding: unused
* - decoding: Set by user
*/
void *hwaccel_context;
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
/**
* Chromaticity coordinates of the source primaries.
* - encoding: Set by user
* - decoding: Set by libavcodec
*/
enum AVColorPrimaries color_primaries;
/**
* Color Transfer Characteristic.
* - encoding: Set by user
* - decoding: Set by libavcodec
*/
enum AVColorTransferCharacteristic color_trc;
/**
* YUV colorspace type.
* - encoding: Set by user
* - decoding: Set by libavcodec
*/
enum AVColorSpace colorspace;
/**
* MPEG vs JPEG YUV range.
* - encoding: Set by user
* - decoding: Set by libavcodec
*/
enum AVColorRange color_range;
/**
* This defines the location of chroma samples.
* - encoding: Set by user
* - decoding: Set by libavcodec
*/
enum AVChromaLocation chroma_sample_location;
Reimar Döffinger
committed
/**
* The codec may call this to execute several independent things.
* It will return only after finishing all tasks.
* The user may replace this with some multithreaded implementation,
* the default implementation will execute the parts serially.
* Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
* @param c context passed also to func
* @param count the number of things to execute
* @param arg2 argument passed unchanged to func
* @param ret return values of executed functions, must have space for "count" values. May be NULL.
* @param func function that will be called count times, with jobnr from 0 to count-1.
* threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
* two instances of func executing at the same time will have the same threadnr.
* @return always 0 currently, but code should handle a future improvement where when any call to func
* returns < 0 no further calls to func may be done and < 0 is returned.
* - encoding: Set by libavcodec, user can override.
* - decoding: Set by libavcodec, user can override.
*/
int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
/**
* AVCodec.
*/
/**
* Name of the codec implementation.
* The name is globally unique among encoders and among decoders (but an
* encoder and a decoder can share the same name).
* This is the primary way to find a codec from the user perspective.
*/
int priv_data_size;
int (*init)(AVCodecContext *);
int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
Thilo Borgmann
committed
int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
/**
* Codec capabilities.
* see CODEC_CAP_*
*/
/**
* Flush buffers.
* Will be called when seeking
*/
const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
Stefano Sabatini
committed
/**
* Descriptive name for the codec, meant to be more human readable than name.
* You should use the NULL_IF_CONFIG_SMALL() macro to define it.
Stefano Sabatini
committed
*/
const char *long_name;
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
const enum SampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
const int64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
/**
* AVHWAccel.
*/
typedef struct AVHWAccel {
/**
* Name of the hardware accelerated codec.
* The name is globally unique among encoders and among decoders (but an
* encoder and a decoder can share the same name).
*/
const char *name;
/**
* Type of codec implemented by the hardware accelerator.
*
* See CODEC_TYPE_xxx
*/
enum CodecType type;
/**
* Codec implemented by the hardware accelerator.
*
* See CODEC_ID_xxx
*/
enum CodecID id;
/**
* Supported pixel format.
*
* Only hardware accelerated formats are supported here.
*/
enum PixelFormat pix_fmt;
/**
* Hardware accelerated codec capabilities.
* see FF_HWACCEL_CODEC_CAP_*
*/
int capabilities;
struct AVHWAccel *next;
/**
* Called at the beginning of each frame or field picture.
*
* Meaningful frame information (codec specific) is guaranteed to
* be parsed at this point. This function is mandatory.
*
* Note that buf can be NULL along with buf_size set to 0.
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
* Otherwise, this means the whole frame is available at this point.
*
* @param avctx the codec context
* @param buf the frame data buffer base
* @param buf_size the size of the frame in bytes
* @return zero if successful, a negative value otherwise
*/
int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
/**
* Callback for each slice.
*
* Meaningful slice information (codec specific) is guaranteed to
* be parsed at this point. This function is mandatory.
*
* @param avctx the codec context
* @param buf the slice data buffer base
* @param buf_size the size of the slice in bytes
* @return zero if successful, a negative value otherwise
*/
int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
/**
* Called at the end of each frame or field picture.
*
* The whole picture is parsed at this point and can now be sent
* to the hardware accelerator. This function is mandatory.
*
* @param avctx the codec context
* @return zero if successful, a negative value otherwise
*/
int (*end_frame)(AVCodecContext *avctx);
/**
* Size of HW accelerator private data.
*
* Private data is allocated with av_mallocz() before
* AVCodecContext.get_buffer() and deallocated after
* AVCodecContext.release_buffer().
*/
int priv_data_size;
} AVHWAccel;
* four components are given, that's all.
* the last component is alpha
*/
#if LIBAVCODEC_VERSION_MAJOR < 53
* AVPaletteControl
* This structure defines a method for communicating palette changes
* between and demuxer and a decoder.
*
* @deprecated Use AVPacket to send palette changes instead.
* This is totally broken.
#define AVPALETTE_SIZE 1024
/* Demuxer sets this to 1 to indicate the palette has changed;
* decoder resets to 0. */
/* 4-byte ARGB palette entries, stored in native byte order; note that
* the individual palette components should be on a 8-bit scale; if
* the palette data comes from an IBM VGA native format, the component
* data is probably 6 bits in size and needs to be scaled. */
unsigned int palette[AVPALETTE_COUNT];
Michael Niedermayer
committed
} AVPaletteControl attribute_deprecated;
#endif
enum AVSubtitleType {
SUBTITLE_NONE,
SUBTITLE_BITMAP, ///< A bitmap, pict will be set
/**
* Plain text, the text field must be set by the decoder and is
* authoritative. ass and pict fields may contain approximations.
*/
SUBTITLE_TEXT,
/**
* Formatted text, the ass field must be set by the decoder and is
* authoritative. pict and text fields may contain approximations.
*/
SUBTITLE_ASS,
};
typedef struct AVSubtitleRect {
int x; ///< top left corner of pict, undefined when pict is not set
int y; ///< top left corner of pict, undefined when pict is not set
int w; ///< width of pict, undefined when pict is not set
int h; ///< height of pict, undefined when pict is not set
int nb_colors; ///< number of colors in pict, undefined when pict is not set
/**
* data+linesize for the bitmap of this subtitle.
* can be set for text/ass as well once they where rendered
*/
AVPicture pict;
enum AVSubtitleType type;
char *text; ///< 0 terminated plain UTF-8 text
/**
* 0 terminated ASS/SSA compatible event line.
* The pressentation of this is unaffected by the other values in this
* struct.
*/
char *ass;
} AVSubtitleRect;
typedef struct AVSubtitle {
uint16_t format; /* 0 = graphics */
uint32_t start_display_time; /* relative to packet pts, in ms */
uint32_t end_display_time; /* relative to packet pts, in ms */
unsigned num_rects;
AVSubtitleRect **rects;
Reimar Döffinger
committed
int64_t pts; ///< Same as packet pts, in AV_TIME_BASE
/* packet functions */
/**
* @deprecated use NULL instead
*/
attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt);
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
/**
* Default packet destructor.
*/
void av_destruct_packet(AVPacket *pkt);
/**
* Initialize optional fields of a packet with default values.
*
* @param pkt packet
*/
void av_init_packet(AVPacket *pkt);
/**
* Allocate the payload of a packet and initialize its fields with
* default values.
*
* @param pkt packet
* @param size wanted payload size
* @return 0 if OK, AVERROR_xxx otherwise
*/
int av_new_packet(AVPacket *pkt, int size);
Reimar Döffinger
committed
/**
* Reduce packet size, correctly zeroing padding
*
* @param pkt packet
* @param size new size
*/
void av_shrink_packet(AVPacket *pkt, int size);
/**
* @warning This is a hack - the packet memory allocation stuff is broken. The
* packet is allocated if it was not really allocated.
*/
int av_dup_packet(AVPacket *pkt);
/**
* Free a packet.
*
* @param pkt packet to free
*/
Michael Niedermayer
committed
struct AVResampleContext;
typedef struct ReSampleContext ReSampleContext;
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
#if LIBAVCODEC_VERSION_MAJOR < 53
/**
* @deprecated Use av_audio_resample_init() instead.
*/
attribute_deprecated ReSampleContext *audio_resample_init(int output_channels, int input_channels,
int output_rate, int input_rate);
#endif
/**
* Initializes audio resampling context
*
* @param output_channels number of output channels
* @param input_channels number of input channels
* @param output_rate output sample rate
* @param input_rate input sample rate
* @param sample_fmt_out requested output sample format
* @param sample_fmt_in input sample format
* @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
* @param log2_phase_count log2 of the number of entries in the polyphase filterbank
* @param linear If 1 then the used FIR filter will be linearly interpolated
between the 2 closest, if 0 the closest will be used
* @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
* @return allocated ReSampleContext, NULL if error occured
*/
ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
int output_rate, int input_rate,
enum SampleFormat sample_fmt_out,
enum SampleFormat sample_fmt_in,
int filter_length, int log2_phase_count,
int linear, double cutoff);
int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
void audio_resample_close(ReSampleContext *s);
/**
* Initializes an audio resampler.
* Note, if either rate is not an integer then simply scale both rates up so they are.
Michael Niedermayer
committed
* @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
* @param log2_phase_count log2 of the number of entries in the polyphase filterbank
* @param linear If 1 then the used FIR filter will be linearly interpolated
between the 2 closest, if 0 the closest will be used
* @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
*/
struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
/**
* resamples.
* @param src an array of unconsumed samples
* @param consumed the number of samples of src which have been consumed are returned here
* @param src_size the number of unconsumed samples available
* @param dst_size the amount of space in samples available in dst
* @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
* @return the number of samples written in dst or -1 if an error occurred
*/
Michael Niedermayer
committed
int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
/**
* Compensates samplerate/timestamp drift. The compensation is done by changing
* the resampler parameters, so no audible clicks or similar distortions occur
* @param compensation_distance distance in output samples over which the compensation should be performed
* @param sample_delta number of output samples which should be output less
*
* example: av_resample_compensate(c, 10, 500)
* here instead of 510 samples only 500 samples would be output
*
* note, due to rounding the actual compensation might be slightly different,
* especially if the compensation_distance is large and the in_rate used during init is small
*/
void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
William Juwono
committed
void av_resample_close(struct AVResampleContext *c);
Michael Niedermayer
committed
/**
* Allocate memory for a picture. Call avpicture_free to free it.
*
* @param picture the picture to be filled in
* @param pix_fmt the format of the picture
* @param width the width of the picture
* @param height the height of the picture
* @return zero if successful, a negative value if not
int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
/**
* Free a picture previously allocated by avpicture_alloc().
*
Panagiotis Issaris
committed
/**
Panagiotis Issaris
committed
* The fields of the given AVPicture are filled in by using the 'ptr' address
* which points to the image data buffer. Depending on the specified picture
* format, one or multiple image data pointers and line sizes will be set.
* If a planar format is specified, several pointers will be set pointing to
* the different picture planes and the line sizes of the different planes
* will be stored in the lines_sizes array.
* Call with ptr == NULL to get the required size for the ptr buffer.
Panagiotis Issaris
committed
*
* @param picture AVPicture whose fields are to be filled in
Panagiotis Issaris
committed
* @param ptr Buffer which will contain or contains the actual image data
* @param pix_fmt The format in which the picture data is stored.
* @param width the width of the image in pixels
* @param height the height of the image in pixels
* @return size of the image data in bytes
Panagiotis Issaris
committed
*/
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
enum PixelFormat pix_fmt, int width, int height);
int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
unsigned char *dest, int dest_size);
Panagiotis Issaris
committed
/**
* Calculate the size in bytes that a picture of the given width and height
* would occupy if stored in the given picture format.
* Note that this returns the size of a compact representation as generated
* by avpicture_layout, which can be smaller than the size required for e.g.
* avpicture_fill.
Panagiotis Issaris
committed
*
* @param pix_fmt the given picture format
* @param width the width of the image
* @param height the height of the image
* @return Image data size in bytes or -1 on error (e.g. too large dimensions).
Panagiotis Issaris
committed
*/
int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
/**
* Returns the pixel format corresponding to the name name.
* If there is no pixel format with name name, then looks for a
* pixel format with the name corresponding to the native endian
* format of name.
* For example in a little-endian system, first looks for "gray16",
* then for "gray16le".
*
* Finally if no pixel format has been found, returns PIX_FMT_NONE.
*/
enum PixelFormat avcodec_get_pix_fmt(const char* name);
unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
Panagiotis Issaris
committed
#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */
#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */
#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */
#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
Fabrice Bellard
committed
Panagiotis Issaris
committed
/**
Panagiotis Issaris
committed
* Computes what kind of losses will occur when converting from one specific
* pixel format to another.
* When converting from one pixel format to another, information loss may occur.
* For example, when converting from RGB24 to GRAY, the color information will
* be lost. Similarly, other losses occur when converting from some formats to
* other formats. These losses can involve loss of chroma, but also loss of
* resolution, loss of color depth, loss due to the color space conversion, loss
* of the alpha bits or loss due to color quantization.
* avcodec_get_fix_fmt_loss() informs you about the various types of losses
* which will occur when converting from one pixel format to another.
Panagiotis Issaris
committed
*
* @param[in] dst_pix_fmt destination pixel format
* @param[in] src_pix_fmt source pixel format
Panagiotis Issaris
committed
* @param[in] has_alpha Whether the source pixel format alpha channel is used.
* @return Combination of flags informing you what kind of losses will occur.
Panagiotis Issaris
committed
*/
int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
Fabrice Bellard
committed
int has_alpha);