FFmpeg
Loading...
Searching...
No Matches
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)
 
#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)
Value:
((int) ((x) * (1 << SCALEBITS) + 0.5))
#define SCALEBITS
Definition colorspace.h:30

Definition at line 28 of file utils.c.

Referenced by rgb24_to_yuv420p().

◆ 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.

Referenced by pgmyuv_save().

◆ DEFAULT_WIDTH

#define DEFAULT_WIDTH   352

Definition at line 102 of file utils.c.

Referenced by main(), and print_help().

◆ DEFAULT_HEIGHT

#define DEFAULT_HEIGHT   288

Definition at line 103 of file utils.c.

Referenced by main(), and print_help().

◆ DEFAULT_NB_PICT

#define DEFAULT_NB_PICT   50

Definition at line 104 of file utils.c.

Referenced by main().

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

Definition at line 158 of file utils.c.

◆ height

int height
static

Definition at line 158 of file utils.c.

◆ wrap

int wrap
static

Definition at line 158 of file utils.c.