FFmpeg
Macros | Functions | Variables
utils.c File Reference
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Macros

#define SCALEBITS   8
 
#define ONE_HALF   (1 << (SCALEBITS - 1))
 
#define FIX(x)   ((int) ((x) * (1 << SCALEBITS) + 0.5))
 
#define err_if(expr)
 
#define DEFAULT_WIDTH   352
 
#define DEFAULT_HEIGHT   288
 
#define DEFAULT_NB_PICT   50
 

Functions

static void rgb24_to_yuv420p (unsigned char *lum, unsigned char *cb, unsigned char *cr, const unsigned char *src, int width, int height)
 
static void pgmyuv_save (const char *filename, int w, int h, const unsigned char *rgb_tab)
 
static void put_pixel (int x, int y, int r, int g, int b)
 

Variables

static unsigned char * rgb_tab
 
static int width
 
static int height
 
static int wrap
 

Macro Definition Documentation

◆ SCALEBITS

#define SCALEBITS   8

Definition at line 26 of file utils.c.

◆ ONE_HALF

#define ONE_HALF   (1 << (SCALEBITS - 1))

Definition at line 27 of file utils.c.

◆ FIX

#define FIX (   x)    ((int) ((x) * (1 << SCALEBITS) + 0.5))

Definition at line 28 of file utils.c.

◆ err_if

#define err_if (   expr)
Value:
do { \
if (expr) { \
fprintf(stderr, "%s\n", strerror(errno)); \
exit(1); \
} \
} while (0)

Definition at line 30 of file utils.c.

◆ DEFAULT_WIDTH

#define DEFAULT_WIDTH   352

Definition at line 102 of file utils.c.

◆ DEFAULT_HEIGHT

#define DEFAULT_HEIGHT   288

Definition at line 103 of file utils.c.

◆ DEFAULT_NB_PICT

#define DEFAULT_NB_PICT   50

Definition at line 104 of file utils.c.

Function Documentation

◆ rgb24_to_yuv420p()

static void rgb24_to_yuv420p ( unsigned char *  lum,
unsigned char *  cb,
unsigned char *  cr,
const unsigned char *  src,
int  width,
int  height 
)
static

Definition at line 37 of file utils.c.

Referenced by pgmyuv_save().

◆ pgmyuv_save()

static void pgmyuv_save ( const char *  filename,
int  w,
int  h,
const unsigned char *  rgb_tab 
)
static

Definition at line 106 of file utils.c.

Referenced by main().

◆ put_pixel()

static void put_pixel ( int  x,
int  y,
int  r,
int  g,
int  b 
)
static

Definition at line 160 of file utils.c.

Variable Documentation

◆ rgb_tab

unsigned char* rgb_tab
static

Definition at line 157 of file utils.c.

Referenced by main(), pgmyuv_save(), and put_pixel().

◆ width

int width
static

◆ height

int height
static

◆ wrap

int wrap
static

Definition at line 158 of file utils.c.

Referenced by put_pixel(), and rgb24_to_yuv420p().