Commit 89c9ff50 authored by Diego Biurrun's avatar Diego Biurrun

spelling/grammar/consistency review part I

Originally committed as revision 16840 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d972e56c
...@@ -48,7 +48,7 @@ int av_stristart(const char *str, const char *pfx, const char **ptr); ...@@ -48,7 +48,7 @@ int av_stristart(const char *str, const char *pfx, const char **ptr);
/** /**
* Copy the string src to dst, but no more than size - 1 bytes, and * Copy the string src to dst, but no more than size - 1 bytes, and
* null terminate dst. * null-terminate dst.
* *
* This function is the same as BSD strlcpy(). * This function is the same as BSD strlcpy().
* *
...@@ -61,7 +61,7 @@ size_t av_strlcpy(char *dst, const char *src, size_t size); ...@@ -61,7 +61,7 @@ size_t av_strlcpy(char *dst, const char *src, size_t size);
/** /**
* Append the string src to the string dst, but to a total length of * Append the string src to the string dst, but to a total length of
* no more than size - 1 bytes, and null terminate dst. * no more than size - 1 bytes, and null-terminate dst.
* *
* This function is similar to BSD strlcat(), but differs when * This function is similar to BSD strlcat(), but differs when
* size <= strlen(dst). * size <= strlen(dst).
......
...@@ -62,11 +62,11 @@ unsigned avutil_version(void); ...@@ -62,11 +62,11 @@ unsigned avutil_version(void);
/** /**
* Pixel format. Notes: * Pixel format. Notes:
* *
* PIX_FMT_RGB32 is handled in an endian-specific manner. A RGBA * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
* color is put together as: * color is put together as:
* (A << 24) | (R << 16) | (G << 8) | B * (A << 24) | (R << 16) | (G << 8) | B
* This is stored as BGRA on little endian CPU architectures and ARGB on * This is stored as BGRA on little-endian CPU architectures and ARGB on
* big endian CPUs. * big-endian CPUs.
* *
* When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
* image data is stored in AVFrame.data[0]. The palette is transported in * image data is stored in AVFrame.data[0]. The palette is transported in
...@@ -79,53 +79,53 @@ unsigned avutil_version(void); ...@@ -79,53 +79,53 @@ unsigned avutil_version(void);
*/ */
enum PixelFormat { enum PixelFormat {
PIX_FMT_NONE= -1, PIX_FMT_NONE= -1,
PIX_FMT_YUV420P, ///< Planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
PIX_FMT_YUYV422, ///< Packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
PIX_FMT_RGB24, ///< Packed RGB 8:8:8, 24bpp, RGBRGB... PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
PIX_FMT_BGR24, ///< Packed RGB 8:8:8, 24bpp, BGRBGR... PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
PIX_FMT_YUV422P, ///< Planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
PIX_FMT_YUV444P, ///< Planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
PIX_FMT_RGB32, ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8R 8G 8B(lsb), in cpu endianness PIX_FMT_RGB32, ///< packed RGB 8:8:8, 32bpp, (msb)8A 8R 8G 8B(lsb), in CPU endianness
PIX_FMT_YUV410P, ///< Planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
PIX_FMT_YUV411P, ///< Planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
PIX_FMT_RGB565, ///< Packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), in cpu endianness PIX_FMT_RGB565, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), in CPU endianness
PIX_FMT_RGB555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in cpu endianness most significant bit to 0 PIX_FMT_RGB555, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in CPU endianness, most significant bit to 0
PIX_FMT_GRAY8, ///< Y , 8bpp PIX_FMT_GRAY8, ///< Y , 8bpp
PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black
PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white
PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
PIX_FMT_YUVJ420P, ///< Planar YUV 4:2:0, 12bpp, full scale (jpeg) PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG)
PIX_FMT_YUVJ422P, ///< Planar YUV 4:2:2, 16bpp, full scale (jpeg) PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG)
PIX_FMT_YUVJ444P, ///< Planar YUV 4:4:4, 24bpp, full scale (jpeg) PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG)
PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h) PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h)
PIX_FMT_XVMC_MPEG2_IDCT, PIX_FMT_XVMC_MPEG2_IDCT,
PIX_FMT_UYVY422, ///< Packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
PIX_FMT_UYYVYY411, ///< Packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
PIX_FMT_BGR32, ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8B 8G 8R(lsb), in cpu endianness PIX_FMT_BGR32, ///< packed RGB 8:8:8, 32bpp, (msb)8A 8B 8G 8R(lsb), in CPU endianness
PIX_FMT_BGR565, ///< Packed RGB 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), in cpu endianness PIX_FMT_BGR565, ///< packed RGB 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), in CPU endianness
PIX_FMT_BGR555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in cpu endianness most significant bit to 1 PIX_FMT_BGR555, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in CPU endianness, most significant bit to 1
PIX_FMT_BGR8, ///< Packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
PIX_FMT_BGR4, ///< Packed RGB 1:2:1, 4bpp, (msb)1B 2G 1R(lsb) PIX_FMT_BGR4, ///< packed RGB 1:2:1, 4bpp, (msb)1B 2G 1R(lsb)
PIX_FMT_BGR4_BYTE, ///< Packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
PIX_FMT_RGB8, ///< Packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
PIX_FMT_RGB4, ///< Packed RGB 1:2:1, 4bpp, (msb)1R 2G 1B(lsb) PIX_FMT_RGB4, ///< packed RGB 1:2:1, 4bpp, (msb)1R 2G 1B(lsb)
PIX_FMT_RGB4_BYTE, ///< Packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
PIX_FMT_NV12, ///< Planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV
PIX_FMT_NV21, ///< as above, but U and V bytes are swapped PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
PIX_FMT_RGB32_1, ///< Packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in cpu endianness PIX_FMT_RGB32_1, ///< packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in CPU endianness
PIX_FMT_BGR32_1, ///< Packed RGB 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in cpu endianness PIX_FMT_BGR32_1, ///< packed RGB 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in CPU endianness
PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
PIX_FMT_YUV440P, ///< Planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
PIX_FMT_YUVJ440P, ///< Planar YUV 4:4:0 full scale (jpeg) PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG)
PIX_FMT_YUVA420P, ///< Planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
PIX_FMT_VDPAU_H264,///< H264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
PIX_FMT_VDPAU_MPEG1,///< MPEG1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
PIX_FMT_VDPAU_MPEG2,///< MPEG2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
PIX_FMT_VDPAU_VC1, ///< VC1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
}; };
......
...@@ -77,8 +77,8 @@ static inline uint64_t av_const bswap_64(uint64_t x) ...@@ -77,8 +77,8 @@ static inline uint64_t av_const bswap_64(uint64_t x)
} }
#endif #endif
// be2me ... BigEndian to MachineEndian // be2me ... big-endian to machine-endian
// le2me ... LittleEndian to MachineEndian // le2me ... little-endian to machine-endian
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
#define be2me_16(x) (x) #define be2me_16(x) (x)
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
#endif #endif
#endif #endif
//rounded divison & shift //rounded division & shift
#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)) #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
/* assume b>0 */ /* assume b>0 */
#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) #define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
...@@ -140,7 +140,7 @@ static inline av_const int av_log2_16bit(unsigned int v) ...@@ -140,7 +140,7 @@ static inline av_const int av_log2_16bit(unsigned int v)
} }
/** /**
* clip a signed integer value into the amin-amax range * Clips a signed integer value into the amin-amax range.
* @param a value to clip * @param a value to clip
* @param amin minimum value of the clip range * @param amin minimum value of the clip range
* @param amax maximum value of the clip range * @param amax maximum value of the clip range
...@@ -154,7 +154,7 @@ static inline av_const int av_clip(int a, int amin, int amax) ...@@ -154,7 +154,7 @@ static inline av_const int av_clip(int a, int amin, int amax)
} }
/** /**
* clip a signed integer value into the 0-255 range * Clips a signed integer value into the 0-255 range.
* @param a value to clip * @param a value to clip
* @return clipped value * @return clipped value
*/ */
...@@ -165,7 +165,7 @@ static inline av_const uint8_t av_clip_uint8(int a) ...@@ -165,7 +165,7 @@ static inline av_const uint8_t av_clip_uint8(int a)
} }
/** /**
* clip a signed integer value into the -32768,32767 range * Clips a signed integer value into the -32768,32767 range.
* @param a value to clip * @param a value to clip
* @return clipped value * @return clipped value
*/ */
...@@ -176,7 +176,7 @@ static inline av_const int16_t av_clip_int16(int a) ...@@ -176,7 +176,7 @@ static inline av_const int16_t av_clip_int16(int a)
} }
/** /**
* clip a float value into the amin-amax range * Clips a float value into the amin-amax range.
* @param a value to clip * @param a value to clip
* @param amin minimum value of the clip range * @param amin minimum value of the clip range
* @param amax maximum value of the clip range * @param amax maximum value of the clip range
...@@ -194,7 +194,7 @@ static inline av_const float av_clipf(float a, float amin, float amax) ...@@ -194,7 +194,7 @@ static inline av_const float av_clipf(float a, float amin, float amax)
/*! /*!
* \def GET_UTF8(val, GET_BYTE, ERROR) * \def GET_UTF8(val, GET_BYTE, ERROR)
* converts a UTF-8 character (up to 4 bytes long) to its 32-bit UCS-4 encoded form * Converts a UTF-8 character (up to 4 bytes long) to its 32-bit UCS-4 encoded form
* \param val is the output and should be of type uint32_t. It holds the converted * \param val is the output and should be of type uint32_t. It holds the converted
* UCS-4 character and should be a left value. * UCS-4 character and should be a left value.
* \param GET_BYTE gets UTF-8 encoded bytes from any proper source. It can be * \param GET_BYTE gets UTF-8 encoded bytes from any proper source. It can be
...@@ -222,19 +222,19 @@ static inline av_const float av_clipf(float a, float amin, float amax) ...@@ -222,19 +222,19 @@ static inline av_const float av_clipf(float a, float amin, float amax)
/*! /*!
* \def PUT_UTF8(val, tmp, PUT_BYTE) * \def PUT_UTF8(val, tmp, PUT_BYTE)
* converts a 32-bit unicode character to its UTF-8 encoded form (up to 4 bytes long). * Converts a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
* \param val is an input only argument and should be of type uint32_t. It holds * \param val is an input-only argument and should be of type uint32_t. It holds
* a ucs4 encoded unicode character that is to be converted to UTF-8. If * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
* val is given as a function it's executed only once. * val is given as a function it is executed only once.
* \param tmp is a temporary variable and should be of type uint8_t. It * \param tmp is a temporary variable and should be of type uint8_t. It
* represents an intermediate value during conversion that is to be * represents an intermediate value during conversion that is to be
* outputted by PUT_BYTE. * output by PUT_BYTE.
* \param PUT_BYTE writes the converted UTF-8 bytes to any proper destination. * \param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
* It could be a function or a statement, and uses tmp as the input byte. * It could be a function or a statement, and uses tmp as the input byte.
* For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
* executed up to 4 times for values in the valid UTF-8 range and up to * executed up to 4 times for values in the valid UTF-8 range and up to
* 7 times in the general case, depending on the length of the converted * 7 times in the general case, depending on the length of the converted
* unicode character. * Unicode character.
*/ */
#define PUT_UTF8(val, tmp, PUT_BYTE)\ #define PUT_UTF8(val, tmp, PUT_BYTE)\
{\ {\
......
...@@ -86,7 +86,7 @@ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){ ...@@ -86,7 +86,7 @@ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){
} }
/** /**
* Get an initialized standard CRC table. * Gets an initialized standard CRC table.
* @param crc_id ID of a standard CRC * @param crc_id ID of a standard CRC
* @return a pointer to the CRC table or NULL on failure * @return a pointer to the CRC table or NULL on failure
*/ */
...@@ -104,8 +104,8 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id){ ...@@ -104,8 +104,8 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id){
} }
/** /**
* Calculate the CRC of a block * Calculates the CRC of a block.
* @param crc CRC of previous blocks if any or initial value for CRC. * @param crc CRC of previous blocks if any or initial value for CRC
* @return CRC updated with the data from the given block * @return CRC updated with the data from the given block
* *
* @see av_crc_init() "le" parameter * @see av_crc_init() "le" parameter
......
...@@ -33,7 +33,7 @@ typedef enum { ...@@ -33,7 +33,7 @@ typedef enum {
AV_CRC_16_CCITT, AV_CRC_16_CCITT,
AV_CRC_32_IEEE, AV_CRC_32_IEEE,
AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */ AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
AV_CRC_MAX, /*< not part of public API! don't use outside lavu */ AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
}AVCRCId; }AVCRCId;
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size); int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
......
/* /*
* A very simple circular buffer FIFO implementation * a very simple circular buffer FIFO implementation
* Copyright (c) 2000, 2001, 2002 Fabrice Bellard * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
* Copyright (c) 2006 Roman Shaposhnik * Copyright (c) 2006 Roman Shaposhnik
* *
...@@ -117,7 +117,7 @@ int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void ...@@ -117,7 +117,7 @@ int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void
return 0; return 0;
} }
/** discard data from the fifo */ /** Discard data from the FIFO. */
void av_fifo_drain(AVFifoBuffer *f, int size) void av_fifo_drain(AVFifoBuffer *f, int size)
{ {
f->rptr += size; f->rptr += size;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/** /**
* @file fifo.h * @file fifo.h
* A very simple circular buffer FIFO implementation. * a very simple circular buffer FIFO implementation
*/ */
#ifndef AVUTIL_FIFO_H #ifndef AVUTIL_FIFO_H
...@@ -64,7 +64,7 @@ int av_fifo_size(AVFifoBuffer *f); ...@@ -64,7 +64,7 @@ int av_fifo_size(AVFifoBuffer *f);
int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size); int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size);
/** /**
* Feeds data from an AVFifoBuffer to a user supplied callback. * Feeds data from an AVFifoBuffer to a user-supplied callback.
* @param *f AVFifoBuffer to read from * @param *f AVFifoBuffer to read from
* @param buf_size number of bytes to read * @param buf_size number of bytes to read
* @param *func generic read function * @param *func generic read function
...@@ -83,16 +83,16 @@ attribute_deprecated void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int ...@@ -83,16 +83,16 @@ attribute_deprecated void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int
#endif #endif
/** /**
* Feeds data from a user supplied callback to an AVFifoBuffer. * Feeds data from a user-supplied callback to an AVFifoBuffer.
* @param *f AVFifoBuffer to write to * @param *f AVFifoBuffer to write to
* @param *src data source * @param *src data source
* @param size number of bytes to write * @param size number of bytes to write
* @param *func generic write function. First parameter is src, * @param *func generic write function; the first parameter is src,
* second is dest_buf, third is dest_buf_size. * the second is dest_buf, the third is dest_buf_size.
* func must return the number of bytes written to dest_buf, or <= 0 to * func must return the number of bytes written to dest_buf, or <= 0 to
* indicate no more data available to write. * indicate no more data available to write.
* If func is NULL, src is interpreted as a simple byte array for source data. * If func is NULL, src is interpreted as a simple byte array for source data.
* @return the number of bytes written to the fifo. * @return the number of bytes written to the FIFO
*/ */
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)); int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
...@@ -110,7 +110,7 @@ attribute_deprecated void av_fifo_realloc(AVFifoBuffer *f, unsigned int size); ...@@ -110,7 +110,7 @@ attribute_deprecated void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
* Resizes an AVFifoBuffer. * Resizes an AVFifoBuffer.
* @param *f AVFifoBuffer to resize * @param *f AVFifoBuffer to resize
* @param size new AVFifoBuffer size in bytes * @param size new AVFifoBuffer size in bytes
* @return <0 for failure >=0 otherwise * @return <0 for failure, >=0 otherwise
*/ */
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size); int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* @file integer.c * @file integer.c
* arbitrary precision integers. * arbitrary precision integers
* @author Michael Niedermayer <michaelni@gmx.at> * @author Michael Niedermayer <michaelni@gmx.at>
*/ */
......
...@@ -48,29 +48,30 @@ int av_log2_i(AVInteger a) av_const; ...@@ -48,29 +48,30 @@ int av_log2_i(AVInteger a) av_const;
AVInteger av_mul_i(AVInteger a, AVInteger b) av_const; AVInteger av_mul_i(AVInteger a, AVInteger b) av_const;
/** /**
* returns 0 if a==b, 1 if a>b and -1 if a<b. * Returns 0 if a==b, 1 if a>b and -1 if a<b.
*/ */
int av_cmp_i(AVInteger a, AVInteger b) av_const; int av_cmp_i(AVInteger a, AVInteger b) av_const;
/** /**
* bitwise shift. * bitwise shift
* @param s the number of bits by which the value should be shifted right, may be negative for shifting left * @param s the number of bits by which the value should be shifted right,
may be negative for shifting left
*/ */
AVInteger av_shr_i(AVInteger a, int s) av_const; AVInteger av_shr_i(AVInteger a, int s) av_const;
/** /**
* returns a % b. * Returns a % b.
* @param quot a/b will be stored here * @param quot a/b will be stored here.
*/ */
AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b); AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b);
/** /**
* returns a/b. * Returns a/b.
*/ */
AVInteger av_div_i(AVInteger a, AVInteger b) av_const; AVInteger av_div_i(AVInteger a, AVInteger b) av_const;
/** /**
* converts the given int64_t to an AVInteger. * Converts the given int64_t to an AVInteger.
*/ */
AVInteger av_int2i(int64_t a) av_const; AVInteger av_int2i(int64_t a) av_const;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/** /**
* @file internal.h * @file internal.h
* common internal api header. * common internal API header
*/ */
#ifndef AVUTIL_INTERNAL_H #ifndef AVUTIL_INTERNAL_H
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/** /**
* @file intfloat_readwrite.c * @file intfloat_readwrite.c
* Portable IEEE float/double read/write functions. * portable IEEE float/double read/write functions
*/ */
#include "common.h" #include "common.h"
...@@ -51,7 +51,7 @@ double av_ext2dbl(const AVExtFloat ext){ ...@@ -51,7 +51,7 @@ double av_ext2dbl(const AVExtFloat ext){
return 0.0/0.0; return 0.0/0.0;
e -= 16383 + 63; /* In IEEE 80 bits, the whole (i.e. 1.xxxx) e -= 16383 + 63; /* In IEEE 80 bits, the whole (i.e. 1.xxxx)
* mantissa bit is written as opposed to the * mantissa bit is written as opposed to the
* single and double precision formats */ * single and double precision formats. */
if (ext.exponent[0]&0x80) if (ext.exponent[0]&0x80)
m= -m; m= -m;
return ldexp(m, e); return ldexp(m, e);
......
...@@ -30,7 +30,7 @@ typedef struct { ...@@ -30,7 +30,7 @@ typedef struct {
void av_lfg_init(AVLFG *c, unsigned int seed); void av_lfg_init(AVLFG *c, unsigned int seed);
/** /**
* Gets the next random unsigned 32bit number using a ALFG. * Gets the next random unsigned 32-bit number using an ALFG.
* *
* Please also consider a simple LCG like state= state*1664525+1013904223, * Please also consider a simple LCG like state= state*1664525+1013904223,
* it may be good enough and faster for your specific use case. * it may be good enough and faster for your specific use case.
...@@ -41,9 +41,9 @@ static inline unsigned int av_lfg_get(AVLFG *c){ ...@@ -41,9 +41,9 @@ static inline unsigned int av_lfg_get(AVLFG *c){
} }
/** /**
* Gets the next random unsigned 32bit number using a MLFG. * Gets the next random unsigned 32-bit number using a MLFG.
* *
* Please also consider the av_lfg_get() above, it is faster. * Please also consider av_lfg_get() above, it is faster.
*/ */
static inline unsigned int av_mlfg_get(AVLFG *c){ static inline unsigned int av_mlfg_get(AVLFG *c){
unsigned int a= c->state[(c->index-55) & 63]; unsigned int a= c->state[(c->index-55) & 63];
......
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "common.h" #include "common.h"
//! avoid e.g. MPlayers fast_memcpy, it slows things down here //! Avoid e.g. MPlayers fast_memcpy, it slows things down here.
#undef memcpy #undef memcpy
#include <string.h> #include <string.h>
#include "lzo.h" #include "lzo.h"
//! define if we may write up to 12 bytes beyond the output buffer //! Define if we may write up to 12 bytes beyond the output buffer.
#define OUTBUF_PADDED 1 #define OUTBUF_PADDED 1
//! define if we may read up to 8 bytes beyond the input buffer //! Define if we may read up to 8 bytes beyond the input buffer.
#define INBUF_PADDED 1 #define INBUF_PADDED 1
typedef struct LZOContext { typedef struct LZOContext {
const uint8_t *in, *in_end; const uint8_t *in, *in_end;
...@@ -52,7 +52,7 @@ static inline int get_byte(LZOContext *c) { ...@@ -52,7 +52,7 @@ static inline int get_byte(LZOContext *c) {
#endif #endif
/** /**
* \brief decode a length value in the coding used by lzo * \brief Decodes a length value in the coding used by lzo.
* \param x previous byte value * \param x previous byte value
* \param mask bits used from x * \param mask bits used from x
* \return decoded length value * \return decoded length value
...@@ -80,7 +80,7 @@ static inline int get_len(LZOContext *c, int x, int mask) { ...@@ -80,7 +80,7 @@ static inline int get_len(LZOContext *c, int x, int mask) {
#endif #endif
/** /**
* \brief copy bytes from input to output buffer with checking * \brief Copies bytes from input to output buffer with checking.
* \param cnt number of bytes to copy, must be >= 0 * \param cnt number of bytes to copy, must be >= 0
*/ */
static inline void copy(LZOContext *c, int cnt) { static inline void copy(LZOContext *c, int cnt) {
...@@ -109,7 +109,7 @@ static inline void copy(LZOContext *c, int cnt) { ...@@ -109,7 +109,7 @@ static inline void copy(LZOContext *c, int cnt) {
static inline void memcpy_backptr(uint8_t *dst, int back, int cnt); static inline void memcpy_backptr(uint8_t *dst, int back, int cnt);
/** /**
* \brief copy previously decoded bytes to current position * \brief Copies previously decoded bytes to current position.
* \param back how many bytes back we start * \param back how many bytes back we start
* \param cnt number of bytes to copy, must be >= 0 * \param cnt number of bytes to copy, must be >= 0
* *
...@@ -179,15 +179,15 @@ void av_memcpy_backptr(uint8_t *dst, int back, int cnt) { ...@@ -179,15 +179,15 @@ void av_memcpy_backptr(uint8_t *dst, int back, int cnt) {
} }
/** /**
* \brief decode LZO 1x compressed data * \brief Decodes LZO 1x compressed data.
* \param out output buffer * \param out output buffer
* \param outlen size of output buffer, number of bytes left are returned here * \param outlen size of output buffer, number of bytes left are returned here
* \param in input buffer * \param in input buffer
* \param inlen size of input buffer, number of bytes left are returned here * \param inlen size of input buffer, number of bytes left are returned here
* \return 0 on success, otherwise error flags, see lzo.h * \return 0 on success, otherwise error flags, see lzo.h
* *
* make sure all buffers are appropriately padded, in must provide * Make sure all buffers are appropriately padded, in must provide
* LZO_INPUT_PADDING, out must provide LZO_OUTPUT_PADDING additional bytes * LZO_INPUT_PADDING, out must provide LZO_OUTPUT_PADDING additional bytes.
*/ */
int lzo1x_decode(void *out, int *outlen, const void *in, int *inlen) { int lzo1x_decode(void *out, int *outlen, const void *in, int *inlen) {
int state= 0; int state= 0;
...@@ -285,7 +285,7 @@ STOP_TIMER("lzod") ...@@ -285,7 +285,7 @@ STOP_TIMER("lzod")
if (memcmp(orig, decomp, s)) if (memcmp(orig, decomp, s))
av_log(NULL, AV_LOG_ERROR, "decompression incorrect\n"); av_log(NULL, AV_LOG_ERROR, "decompression incorrect\n");
else else
av_log(NULL, AV_LOG_ERROR, "decompression ok\n"); av_log(NULL, AV_LOG_ERROR, "decompression OK\n");
return 0; return 0;
} }
#endif #endif
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/** /**
* @file mathematics.c * @file mathematics.c
* Miscellaneous math routines and tables. * miscellaneous math routines and tables
*/ */
#include <assert.h> #include <assert.h>
......
...@@ -42,29 +42,29 @@ ...@@ -42,29 +42,29 @@
#endif #endif
enum AVRounding { enum AVRounding {
AV_ROUND_ZERO = 0, ///< round toward zero AV_ROUND_ZERO = 0, ///< Round toward zero.
AV_ROUND_INF = 1, ///< round away from zero AV_ROUND_INF = 1, ///< Round away from zero.
AV_ROUND_DOWN = 2, ///< round toward -infinity AV_ROUND_DOWN = 2, ///< Round toward -infinity.
AV_ROUND_UP = 3, ///< round toward +infinity AV_ROUND_UP = 3, ///< Round toward +infinity.
AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
}; };
int64_t av_const av_gcd(int64_t a, int64_t b); int64_t av_const av_gcd(int64_t a, int64_t b);
/** /**
* rescale a 64bit integer with rounding to nearest. * Rescales a 64-bit integer with rounding to nearest.
* a simple a*b/c isn't possible as it can overflow * A simple a*b/c isn't possible as it can overflow.
*/ */
int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const; int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
/** /**
* rescale a 64bit integer with specified rounding. * Rescales a 64-bit integer with specified rounding.
* a simple a*b/c isn't possible as it can overflow * A simple a*b/c isn't possible as it can overflow.
*/ */
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const; int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
/** /**
* rescale a 64bit integer by 2 rational numbers. * Rescales a 64-bit integer by 2 rational numbers.
*/ */
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const; int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
......
...@@ -43,29 +43,29 @@ typedef struct AVMD5{ ...@@ -43,29 +43,29 @@ typedef struct AVMD5{
const int av_md5_size= sizeof(AVMD5); const int av_md5_size= sizeof(AVMD5);
static const uint8_t S[4][4] = { static const uint8_t S[4][4] = {
{ 7, 12, 17, 22 }, /* Round 1 */ { 7, 12, 17, 22 }, /* round 1 */
{ 5, 9, 14, 20 }, /* Round 2 */ { 5, 9, 14, 20 }, /* round 2 */
{ 4, 11, 16, 23 }, /* Round 3 */ { 4, 11, 16, 23 }, /* round 3 */
{ 6, 10, 15, 21 } /* Round 4 */ { 6, 10, 15, 21 } /* round 4 */
}; };
static const uint32_t T[64] = { // T[i]= fabs(sin(i+1)<<32) static const uint32_t T[64] = { // T[i]= fabs(sin(i+1)<<32)
0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, /* Round 1 */ 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, /* round 1 */
0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, /* Round 2 */ 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, /* round 2 */
0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,
0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, /* Round 3 */ 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, /* round 3 */
0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05,
0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, /* Round 4 */ 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, /* round 4 */
0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* @file mem.c * @file mem.c
* default memory allocator for libavutil. * default memory allocator for libavutil
*/ */
#include "config.h" #include "config.h"
...@@ -35,14 +35,14 @@ ...@@ -35,14 +35,14 @@
#include "mem.h" #include "mem.h"
/* here we can use OS dependent allocation functions */ /* here we can use OS-dependent allocation functions */
#undef free #undef free
#undef malloc #undef malloc
#undef realloc #undef realloc
/* you can redefine av_malloc and av_free in your project to use your /* You can redefine av_malloc and av_free in your project to use your
memory allocator. You do not need to suppress this file because the memory allocator. You do not need to suppress this file because the
linker will do it automatically */ linker will do it automatically. */
void *av_malloc(unsigned int size) void *av_malloc(unsigned int size)
{ {
...@@ -70,7 +70,7 @@ void *av_malloc(unsigned int size) ...@@ -70,7 +70,7 @@ void *av_malloc(unsigned int size)
Indeed, we should align it: Indeed, we should align it:
on 4 for 386 on 4 for 386
on 16 for 486 on 16 for 486
on 32 for 586, PPro - k6-III on 32 for 586, PPro - K6-III
on 64 for K7 (maybe for P3 too). on 64 for K7 (maybe for P3 too).
Because L1 and L2 caches are aligned on those values. Because L1 and L2 caches are aligned on those values.
But I don't want to code such logic here! But I don't want to code such logic here!
...@@ -78,10 +78,10 @@ void *av_malloc(unsigned int size) ...@@ -78,10 +78,10 @@ void *av_malloc(unsigned int size)
/* Why 16? /* Why 16?
Because some CPUs need alignment, for example SSE2 on P4, & most RISC CPUs Because some CPUs need alignment, for example SSE2 on P4, & most RISC CPUs
it will just trigger an exception and the unaligned load will be done in the it will just trigger an exception and the unaligned load will be done in the
exception handler or it will just segfault (SSE2 on P4) exception handler or it will just segfault (SSE2 on P4).
Why not larger? Because I did not see a difference in benchmarks ... Why not larger? Because I did not see a difference in benchmarks ...
*/ */
/* benchmarks with p3 /* benchmarks with P3
memalign(64)+1 3071,3051,3032 memalign(64)+1 3071,3051,3032
memalign(64)+2 3051,3032,3041 memalign(64)+2 3051,3032,3041
memalign(64)+4 2911,2896,2915 memalign(64)+4 2911,2896,2915
...@@ -90,7 +90,7 @@ void *av_malloc(unsigned int size) ...@@ -90,7 +90,7 @@ void *av_malloc(unsigned int size)
memalign(64)+32 2546,2545,2571 memalign(64)+32 2546,2545,2571
memalign(64)+64 2570,2533,2558 memalign(64)+64 2570,2533,2558
btw, malloc seems to do 8 byte alignment by default here BTW, malloc seems to do 8-byte alignment by default here.
*/ */
#else #else
ptr = malloc(size); ptr = malloc(size);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/** /**
* @file mem.h * @file mem.h
* Memory handling functions. * memory handling functions
*/ */
#ifndef AVUTIL_MEM_H #ifndef AVUTIL_MEM_H
...@@ -41,31 +41,31 @@ ...@@ -41,31 +41,31 @@
#endif #endif
/** /**
* Allocate a block of \p size bytes with alignment suitable for all * Allocates a block of \p size bytes with alignment suitable for all
* memory accesses (including vectors if available on the CPU). * memory accesses (including vectors if available on the CPU).
* @param size Size in bytes for the memory block to be allocated. * @param size Size in bytes for the memory block to be allocated.
* @return Pointer to the allocated block, NULL if it cannot allocate * @return Pointer to the allocated block, NULL if the block cannot
* it. * be allocated.
* @see av_mallocz() * @see av_mallocz()
*/ */
void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1); void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1);
/** /**
* Allocate or reallocate a block of memory. * Allocates or reallocates a block of memory.
* If \p ptr is NULL and \p size > 0, allocate a new block. If \p * If \p ptr is NULL and \p size > 0, allocates a new block. If \p
* size is zero, free the memory block pointed by \p ptr. * size is zero, frees the memory block pointed to by \p ptr.
* @param size Size in bytes for the memory block to be allocated or * @param size Size in bytes for the memory block to be allocated or
* reallocated. * reallocated.
* @param ptr Pointer to a memory block already allocated with * @param ptr Pointer to a memory block already allocated with
* av_malloc(z)() or av_realloc() or NULL. * av_malloc(z)() or av_realloc() or NULL.
* @return Pointer to a newly reallocated block or NULL if it cannot * @return Pointer to a newly reallocated block or NULL if the block
* reallocate or the function is used to free the memory block. * cannot be reallocated or the function is used to free the memory block.
* @see av_fast_realloc() * @see av_fast_realloc()
*/ */
void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2); void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2);
/** /**
* Free a memory block which has been allocated with av_malloc(z)() or * Frees a memory block which has been allocated with av_malloc(z)() or
* av_realloc(). * av_realloc().
* @param ptr Pointer to the memory block which should be freed. * @param ptr Pointer to the memory block which should be freed.
* @note ptr = NULL is explicitly allowed. * @note ptr = NULL is explicitly allowed.
...@@ -75,27 +75,26 @@ void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2); ...@@ -75,27 +75,26 @@ void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2);
void av_free(void *ptr); void av_free(void *ptr);
/** /**
* Allocate a block of \p size bytes with alignment suitable for all * Allocates a block of \p size bytes with alignment suitable for all
* memory accesses (including vectors if available on the CPU) and * memory accesses (including vectors if available on the CPU) and
* set to zeroes all the bytes of the block. * zeroes all the bytes of the block.
* @param size Size in bytes for the memory block to be allocated. * @param size Size in bytes for the memory block to be allocated.
* @return Pointer to the allocated block, NULL if it cannot allocate * @return Pointer to the allocated block, NULL if it cannot be allocated.
* it.
* @see av_malloc() * @see av_malloc()
*/ */
void *av_mallocz(unsigned int size) av_malloc_attrib av_alloc_size(1); void *av_mallocz(unsigned int size) av_malloc_attrib av_alloc_size(1);
/** /**
* Duplicate the string \p s. * Duplicates the string \p s.
* @param s String to be duplicated. * @param s string to be duplicated
* @return Pointer to a newly allocated string containing a * @return Pointer to a newly allocated string containing a
* copy of \p s or NULL if it cannot be allocated. * copy of \p s or NULL if the string cannot be allocated.
*/ */
char *av_strdup(const char *s) av_malloc_attrib; char *av_strdup(const char *s) av_malloc_attrib;
/** /**
* Free a memory block which has been allocated with av_malloc(z)() or * Frees a memory block which has been allocated with av_malloc(z)() or
* av_realloc() and set to NULL the pointer to it. * av_realloc() and set the pointer pointing to it to NULL.
* @param ptr Pointer to the pointer to the memory block which should * @param ptr Pointer to the pointer to the memory block which should
* be freed. * be freed.
* @see av_free() * @see av_free()
......
/* /*
* Principal component analysis * principal component analysis (PCA)
* Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at> * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
* *
* This file is part of FFmpeg. * This file is part of FFmpeg.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* @file pca.c * @file pca.c
* Principal component analysis * principal component analysis (PCA)
*/ */
#include "common.h" #include "common.h"
...@@ -120,7 +120,7 @@ int ff_pca(PCA *pca, double *eigenvector, double *eigenvalue){ ...@@ -120,7 +120,7 @@ int ff_pca(PCA *pca, double *eigenvector, double *eigenvalue){
if(pass < 3 && fabs(covar) < sum / (5*n*n)) //FIXME why pass < 3 if(pass < 3 && fabs(covar) < sum / (5*n*n)) //FIXME why pass < 3
continue; continue;
if(fabs(covar) == 0.0) //FIXME shouldnt be needed if(fabs(covar) == 0.0) //FIXME should not be needed
continue; continue;
if(pass >=3 && fabs((eigenvalue[j]+z[j])/covar) > (1LL<<32) && fabs((eigenvalue[i]+z[i])/covar) > (1LL<<32)){ if(pass >=3 && fabs((eigenvalue[j]+z[j])/covar) > (1LL<<32) && fabs((eigenvalue[i]+z[i])/covar) > (1LL<<32)){
pca->covariance[j + i*n]=0.0; pca->covariance[j + i*n]=0.0;
......
/* /*
* Principal component analysis * principal component analysis (PCA)
* Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at> * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
* *
* This file is part of FFmpeg. * This file is part of FFmpeg.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* @file pca.h * @file pca.h
* Principal component analysis * principal component analysis (PCA)
*/ */
#ifndef AVUTIL_PCA_H #ifndef AVUTIL_PCA_H
......
...@@ -29,19 +29,19 @@ see http://en.wikipedia.org/wiki/Mersenne_twister for an explanation of this alg ...@@ -29,19 +29,19 @@ see http://en.wikipedia.org/wiki/Mersenne_twister for an explanation of this alg
#include "random.h" #include "random.h"
/* Period parameters */ /* period parameters */
#define M 397 #define M 397
#define A 0x9908b0df /* constant vector a */ #define A 0x9908b0df /* constant vector a */
#define UPPER_MASK 0x80000000 /* most significant w-r bits */ #define UPPER_MASK 0x80000000 /* most significant w-r bits */
#define LOWER_MASK 0x7fffffff /* least significant r bits */ #define LOWER_MASK 0x7fffffff /* least significant r bits */
/** initializes mt[AV_RANDOM_N] with a seed */ /** Initializes mt[AV_RANDOM_N] with a seed. */
void av_random_init(AVRandomState *state, unsigned int seed) void av_random_init(AVRandomState *state, unsigned int seed)
{ {
int index; int index;
/* /*
This differs from the wikipedia article. Source is from the This differs from the Wikipedia article. Source is from the
Makoto Matsumoto and Takuji Nishimura code, with the following comment: Makoto Matsumoto and Takuji Nishimura code, with the following comment:
*/ */
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
......
/* /*
* Rational numbers * rational numbers
* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at> * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
* *
* This file is part of FFmpeg. * This file is part of FFmpeg.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* @file rational.c * @file rational.c
* Rational numbers * rational numbers
* @author Michael Niedermayer <michaelni@gmx.at> * @author Michael Niedermayer <michaelni@gmx.at>
*/ */
......
/* /*
* Rational numbers * rational numbers
* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at> * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
* *
* This file is part of FFmpeg. * This file is part of FFmpeg.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/** /**
* @file rational.h * @file rational.h
* Rational numbers. * rational numbers
* @author Michael Niedermayer <michaelni@gmx.at> * @author Michael Niedermayer <michaelni@gmx.at>
*/ */
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "common.h" #include "common.h"
/** /**
* Rational number num/den. * rational number numerator/denominator
*/ */
typedef struct AVRational{ typedef struct AVRational{
int num; ///< numerator int num; ///< numerator
...@@ -40,10 +40,10 @@ typedef struct AVRational{ ...@@ -40,10 +40,10 @@ typedef struct AVRational{
} AVRational; } AVRational;
/** /**
* Compare two rationals. * Compares two rationals.
* @param a first rational * @param a first rational
* @param b second rational * @param b second rational
* @return 0 if a==b, 1 if a>b and -1 if a<b. * @return 0 if a==b, 1 if a>b and -1 if a<b
*/ */
static inline int av_cmp_q(AVRational a, AVRational b){ static inline int av_cmp_q(AVRational a, AVRational b){
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den; const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
...@@ -53,7 +53,7 @@ static inline int av_cmp_q(AVRational a, AVRational b){ ...@@ -53,7 +53,7 @@ static inline int av_cmp_q(AVRational a, AVRational b){
} }
/** /**
* Rational to double conversion. * Converts rational to double.
* @param a rational to convert * @param a rational to convert
* @return (double) a * @return (double) a
*/ */
...@@ -62,7 +62,7 @@ static inline double av_q2d(AVRational a){ ...@@ -62,7 +62,7 @@ static inline double av_q2d(AVRational a){
} }
/** /**
* Reduce a fraction. * Reduces a fraction.
* This is useful for framerate calculations. * This is useful for framerate calculations.
* @param dst_nom destination numerator * @param dst_nom destination numerator
* @param dst_den destination denominator * @param dst_den destination denominator
...@@ -75,33 +75,33 @@ int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max) ...@@ -75,33 +75,33 @@ int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max)
/** /**
* Multiplies two rationals. * Multiplies two rationals.
* @param b first rational. * @param b first rational
* @param c second rational. * @param c second rational
* @return b*c. * @return b*c
*/ */
AVRational av_mul_q(AVRational b, AVRational c) av_const; AVRational av_mul_q(AVRational b, AVRational c) av_const;
/** /**
* Divides one rational by another. * Divides one rational by another.
* @param b first rational. * @param b first rational
* @param c second rational. * @param c second rational
* @return b/c. * @return b/c
*/ */
AVRational av_div_q(AVRational b, AVRational c) av_const; AVRational av_div_q(AVRational b, AVRational c) av_const;
/** /**
* Adds two rationals. * Adds two rationals.
* @param b first rational. * @param b first rational
* @param c second rational. * @param c second rational
* @return b+c. * @return b+c
*/ */
AVRational av_add_q(AVRational b, AVRational c) av_const; AVRational av_add_q(AVRational b, AVRational c) av_const;
/** /**
* Subtracts one rational from another. * Subtracts one rational from another.
* @param b first rational. * @param b first rational
* @param c second rational. * @param c second rational
* @return b-c. * @return b-c
*/ */
AVRational av_sub_q(AVRational b, AVRational c) av_const; AVRational av_sub_q(AVRational b, AVRational c) av_const;
...@@ -109,7 +109,7 @@ AVRational av_sub_q(AVRational b, AVRational c) av_const; ...@@ -109,7 +109,7 @@ AVRational av_sub_q(AVRational b, AVRational c) av_const;
* Converts a double precision floating point number to a rational. * Converts a double precision floating point number to a rational.
* @param d double to convert * @param d double to convert
* @param max the maximum allowed numerator and denominator * @param max the maximum allowed numerator and denominator
* @return (AVRational) d. * @return (AVRational) d
*/ */
AVRational av_d2q(double d, int max) av_const; AVRational av_d2q(double d, int max) av_const;
......
...@@ -168,7 +168,7 @@ int main(void){ ...@@ -168,7 +168,7 @@ int main(void){
printf("%02X", digest[i]); printf("%02X", digest[i]);
putchar('\n'); putchar('\n');
} }
//Test Vectors (from FIPS PUB 180-1) //test vectors (from FIPS PUB 180-1)
printf("A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D\n" printf("A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D\n"
"84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1\n" "84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1\n"
"34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F\n"); "34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F\n");
......
...@@ -72,10 +72,9 @@ static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){ ...@@ -72,10 +72,9 @@ static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){
} }
/** /**
* * @return Will not be more denormalized than a+b. So if either input is
* @return will not be more denormalized then a+b, so if either input is * normalized, then the output will not be worse then the other input.
* normalized then the output will not be worse then the other input * If both are normalized, then the output will be normalized.
* if both are normalized then the output will be normalized
*/ */
static inline av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b){ static inline av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b){
a.exp += b.exp; a.exp += b.exp;
...@@ -84,9 +83,8 @@ static inline av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b){ ...@@ -84,9 +83,8 @@ static inline av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b){
} }
/** /**
* * b has to be normalized and not zero.
* b has to be normalized and not zero * @return Will not be more denormalized than a.
* @return will not be more denormalized then a
*/ */
static av_const SoftFloat av_div_sf(SoftFloat a, SoftFloat b){ static av_const SoftFloat av_div_sf(SoftFloat a, SoftFloat b){
a.exp -= b.exp+1; a.exp -= b.exp+1;
...@@ -117,8 +115,7 @@ static inline av_const SoftFloat av_int2sf(int v, int frac_bits){ ...@@ -117,8 +115,7 @@ static inline av_const SoftFloat av_int2sf(int v, int frac_bits){
} }
/** /**
* * Rounding is to -inf.
* rounding is to -inf
*/ */
static inline av_const int av_sf2int(SoftFloat v, int frac_bits){ static inline av_const int av_sf2int(SoftFloat v, int frac_bits){
v.exp += frac_bits - ONE_BITS; v.exp += frac_bits - ONE_BITS;
......
...@@ -199,7 +199,7 @@ int main(void){ ...@@ -199,7 +199,7 @@ int main(void){
av_tree_insert(&root, (void*)(j+1), cmp, &node2); av_tree_insert(&root, (void*)(j+1), cmp, &node2);
k= av_tree_find(root, (void*)(j+1), cmp, NULL); k= av_tree_find(root, (void*)(j+1), cmp, NULL);
if(k) if(k)
av_log(NULL, AV_LOG_ERROR, "removial failure %d\n", i); av_log(NULL, AV_LOG_ERROR, "removal failure %d\n", i);
} }
} }
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment