comparison avcodec.h @ 4593:2aea8bf268d8 libavcodec

Move the unaltered documentation of the functions which are part of the public API out of imgconvert.c into avcodec.h.
author takis
date Sun, 25 Feb 2007 07:53:44 +0000
parents fc155ff94878
children 2cd245d65761
comparison
equal deleted inserted replaced
4592:9fc8acda3223 4593:2aea8bf268d8
2449 * 2449 *
2450 * @param picture The AVPicture to be freed. 2450 * @param picture The AVPicture to be freed.
2451 */ 2451 */
2452 void avpicture_free(AVPicture *picture); 2452 void avpicture_free(AVPicture *picture);
2453 2453
2454 /**
2455 * Fill in AVPicture's fields.
2456 * The fields of the given AVPicture are filled in by using the 'ptr' address
2457 * which points to the image data buffer. Depending on the specified picture
2458 * format, one or multiple image data pointers and line sizes will be set.
2459 * If a planar format is specified, several pointers will be set pointing to
2460 * the different picture planes and the line sizes of the different planes
2461 * will be stored in the lines_sizes array.
2462 *
2463 * @param picture AVPicture who's fields are to be filled in
2464 * @param ptr Buffer which will contain or contains the actual image data
2465 * @param pix_fmt The format in which the picture data is stored
2466 * @param width The width of the image in pixels
2467 * @param height The height of the image in pixels
2468 * @return Size of the image data in bytes.
2469 */
2454 int avpicture_fill(AVPicture *picture, uint8_t *ptr, 2470 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
2455 int pix_fmt, int width, int height); 2471 int pix_fmt, int width, int height);
2456 int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height, 2472 int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
2457 unsigned char *dest, int dest_size); 2473 unsigned char *dest, int dest_size);
2474
2475 /**
2476 * Calculate the size in bytes that a picture of the given width and height
2477 * would occupy if stored in the given picture format.
2478 *
2479 * @param pix_fmt The given picture format
2480 * @param width The width of the image
2481 * @param height The height of the image
2482 * @return Image data size in bytes
2483 */
2458 int avpicture_get_size(int pix_fmt, int width, int height); 2484 int avpicture_get_size(int pix_fmt, int width, int height);
2459 void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift); 2485 void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
2460 const char *avcodec_get_pix_fmt_name(int pix_fmt); 2486 const char *avcodec_get_pix_fmt_name(int pix_fmt);
2461 void avcodec_set_dimensions(AVCodecContext *s, int width, int height); 2487 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
2462 enum PixelFormat avcodec_get_pix_fmt(const char* name); 2488 enum PixelFormat avcodec_get_pix_fmt(const char* name);
2467 #define FF_LOSS_COLORSPACE 0x0004 /* loss due to color space conversion */ 2493 #define FF_LOSS_COLORSPACE 0x0004 /* loss due to color space conversion */
2468 #define FF_LOSS_ALPHA 0x0008 /* loss of alpha bits */ 2494 #define FF_LOSS_ALPHA 0x0008 /* loss of alpha bits */
2469 #define FF_LOSS_COLORQUANT 0x0010 /* loss due to color quantization */ 2495 #define FF_LOSS_COLORQUANT 0x0010 /* loss due to color quantization */
2470 #define FF_LOSS_CHROMA 0x0020 /* loss of chroma (e.g. rgb to gray conversion) */ 2496 #define FF_LOSS_CHROMA 0x0020 /* loss of chroma (e.g. rgb to gray conversion) */
2471 2497
2498 /**
2499 * compute the loss when converting from a pixel format to another
2500 */
2472 int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt, 2501 int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
2473 int has_alpha); 2502 int has_alpha);
2503
2504 /**
2505 * find best pixel format to convert to. Return -1 if none found
2506 */
2474 int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt, 2507 int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,
2475 int has_alpha, int *loss_ptr); 2508 int has_alpha, int *loss_ptr);
2476 2509
2477 #define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */ 2510 #define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */
2478 #define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */ 2511 #define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */
2512
2513 /**
2514 * Tell if an image really has transparent alpha values.
2515 * @return ored mask of FF_ALPHA_xxx constants
2516 */
2479 int img_get_alpha_info(const AVPicture *src, 2517 int img_get_alpha_info(const AVPicture *src,
2480 int pix_fmt, int width, int height); 2518 int pix_fmt, int width, int height);
2481 2519
2482 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) 2520 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
2483 /* convert among pixel formats */ 2521 /* convert among pixel formats */
2485 const AVPicture *src, int pix_fmt, 2523 const AVPicture *src, int pix_fmt,
2486 int width, int height); 2524 int width, int height);
2487 #endif 2525 #endif
2488 2526
2489 /* deinterlace a picture */ 2527 /* deinterlace a picture */
2528 /* deinterlace - if not supported return -1 */
2490 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, 2529 int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
2491 int pix_fmt, int width, int height); 2530 int pix_fmt, int width, int height);
2492 2531
2493 /* external high level API */ 2532 /* external high level API */
2494 2533
2919 * @param[in] size The amount of memory you need in bytes. 2958 * @param[in] size The amount of memory you need in bytes.
2920 * @return Block of memory of the requested size. 2959 * @return Block of memory of the requested size.
2921 */ 2960 */
2922 void *av_mallocz_static(unsigned int size); 2961 void *av_mallocz_static(unsigned int size);
2923 2962
2963 /**
2964 * Copy image 'src' to 'dst'.
2965 */
2924 void img_copy(AVPicture *dst, const AVPicture *src, 2966 void img_copy(AVPicture *dst, const AVPicture *src,
2925 int pix_fmt, int width, int height); 2967 int pix_fmt, int width, int height);
2926 2968
2969 /**
2970 * Crop image top and left side
2971 */
2927 int img_crop(AVPicture *dst, const AVPicture *src, 2972 int img_crop(AVPicture *dst, const AVPicture *src,
2928 int pix_fmt, int top_band, int left_band); 2973 int pix_fmt, int top_band, int left_band);
2929 2974
2975 /**
2976 * Pad image
2977 */
2930 int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt, 2978 int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
2931 int padtop, int padbottom, int padleft, int padright, int *color); 2979 int padtop, int padbottom, int padleft, int padright, int *color);
2932 2980
2933 extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v); 2981 extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
2934 2982