output.c File Reference

Output an image and Trance support. More...

#include "contributors.h"
#include "global.h"
#include "mbuffer.h"
#include "image.h"
#include "memalloc.h"
#include "sei.h"

Include dependency graph for output.c:

Go to the source code of this file.

Functions

static void write_out_picture (StorablePicture *p, int p_out)
static void img2buf_byte (imgpel **imgX, unsigned char *buf, int size_x, int size_y, int symbol_size_in_bytes, int crop_left, int crop_right, int crop_top, int crop_bottom)
static void img2buf_normal (imgpel **imgX, unsigned char *buf, int size_x, int size_y, int symbol_size_in_bytes, int crop_left, int crop_right, int crop_top, int crop_bottom)
static void img2buf_endian (imgpel **imgX, unsigned char *buf, int size_x, int size_y, int symbol_size_in_bytes, int crop_left, int crop_right, int crop_top, int crop_bottom)
int testEndian (void)
static void initOutput (int symbol_size_in_bytes)
void write_picture (StorablePicture *p, int p_out, int real_structure)
void init_out_buffer (void)
void uninit_out_buffer (void)
void clear_picture (StorablePicture *p)
void write_unpaired_field (FrameStore *fs, int p_out)
void flush_direct_output (int p_out)
void write_stored_frame (FrameStore *fs, int p_out)
void direct_output (StorablePicture *p, int p_out)

Variables

FrameStore * out_buffer
StorablePicture * pending_output = NULL
int pending_output_state = FRAME
int recovery_flag = 0
int non_conforming_stream
static void(* img2buf )(imgpel **imgX, unsigned char *buf, int size_x, int size_y, int symbol_size_in_bytes, int crop_left, int crop_right, int crop_top, int crop_bottom)


Detailed Description

Output an image and Trance support.

Author:
Main contributors (see contributors.h for copyright, address and affiliation details)

Definition in file output.c.


Function Documentation

void clear_picture ( StorablePicture *  p  ) 

Initialize picture memory with (Y:0,U:128,V:128).

Definition at line 637 of file output.c.

References img, storable_picture::imgUV, storable_picture::imgY, storable_picture::size_x, storable_picture::size_x_cr, storable_picture::size_y, and storable_picture::size_y_cr.

Referenced by write_unpaired_field().

void direct_output ( StorablePicture *  p,
int  p_out 
)

Directly output a picture without storing it in the DPB. Fields are buffered before they are written to the file.

Parameters:
p Picture for output
p_out Output file

Definition at line 773 of file output.c.

References frame_store::bottom_field, calculate_frame_no(), dpb_combine_field_yuv(), find_snr(), flush_direct_output(), frame_store::frame, free_storable_picture(), frame_store::is_used, p_ref, params, snr, storable_picture::structure, frame_store::top_field, and write_picture().

Referenced by store_picture_in_dpb().

Here is the call graph for this function:

void flush_direct_output ( int  p_out  ) 

Write out unpaired fields from output buffer.

Parameters:
p_out Output file

Definition at line 718 of file output.c.

References frame_store::bottom_field, frame_store::frame, free_storable_picture(), frame_store::is_used, frame_store::top_field, and write_unpaired_field().

Referenced by direct_output(), and write_stored_frame().

Here is the call graph for this function:

static void img2buf_byte ( imgpel **  imgX,
unsigned char *  buf,
int  size_x,
int  size_y,
int  symbol_size_in_bytes,
int  crop_left,
int  crop_right,
int  crop_top,
int  crop_bottom 
) [static]

Convert image plane to temporary buffer for file writing.

Parameters:
imgX Pointer to image plane
buf Buffer for file output
size_x horizontal size
size_y vertical size
symbol_size_in_bytes number of bytes used per pel
crop_left pixels to crop from left
crop_right pixels to crop from right
crop_top pixels to crop from top
crop_bottom pixels to crop from bottom

Definition at line 181 of file output.c.

Referenced by initOutput().

static void img2buf_endian ( imgpel **  imgX,
unsigned char *  buf,
int  size_x,
int  size_y,
int  symbol_size_in_bytes,
int  crop_left,
int  crop_right,
int  crop_top,
int  crop_bottom 
) [static]

Convert image plane to temporary buffer for file writing.

Parameters:
imgX Pointer to image plane
buf Buffer for file output
size_x horizontal size
size_y vertical size
symbol_size_in_bytes number of bytes used per pel
crop_left pixels to crop from left
crop_right pixels to crop from right
crop_top pixels to crop from top
crop_bottom pixels to crop from bottom

Definition at line 221 of file output.c.

References error().

Referenced by initOutput().

Here is the call graph for this function:

static void img2buf_normal ( imgpel **  imgX,
unsigned char *  buf,
int  size_x,
int  size_y,
int  symbol_size_in_bytes,
int  crop_left,
int  crop_right,
int  crop_top,
int  crop_bottom 
) [static]

Convert image plane to temporary buffer for file writing.

Parameters:
imgX Pointer to image plane
buf Buffer for file output
size_x horizontal size
size_y vertical size
symbol_size_in_bytes number of bytes used per pel
crop_left pixels to crop from left
crop_right pixels to crop from right
crop_top pixels to crop from top
crop_bottom pixels to crop from bottom

Definition at line 106 of file output.c.

Referenced by initOutput().

void init_out_buffer ( void   ) 

Initialize output buffer for direct output.

Definition at line 603 of file output.c.

References alloc_frame_store(), storable_picture::imgUV, storable_picture::imgY, and no_mem_exit().

Referenced by main().

Here is the call graph for this function:

static void initOutput ( int  symbol_size_in_bytes  )  [static]

selects appropriate output function given system arch. and data

Returns:

Definition at line 67 of file output.c.

References img2buf_byte(), img2buf_endian(), img2buf_normal(), and testEndian().

Referenced by write_out_picture().

Here is the call graph for this function:

int testEndian ( void   ) 

checks if the System is big- or little-endian

Returns:
0, little-endian (e.g. Intel architectures) 1, big-endian (e.g. SPARC, MIPS, PowerPC)

Definition at line 46 of file output.c.

Referenced by buf2img(), and initOutput().

void uninit_out_buffer ( void   ) 

Uninitialize output buffer for direct output.

Definition at line 621 of file output.c.

References free_frame_store().

Referenced by main().

Here is the call graph for this function:

static void write_out_picture ( StorablePicture *  p,
int  p_out 
) [static]

void write_picture ( StorablePicture *  p,
int  p_out,
int  real_structure 
)

Writes out a storable picture without doing any output modifications.

Parameters:
p Picture to be written
p_out Output file
real_structure real picture structure

Definition at line 437 of file output.c.

References write_out_picture().

Referenced by direct_output(), write_stored_frame(), and write_unpaired_field().

Here is the call graph for this function:

void write_stored_frame ( FrameStore *  fs,
int  p_out 
)

Write a frame (from FrameStore).

Parameters:
fs FrameStore containing the frame
p_out Output file

Definition at line 742 of file output.c.

References flush_direct_output(), frame_store::frame, frame_store::is_output, frame_store::is_used, frame_store::recovery_frame, write_picture(), and write_unpaired_field().

Referenced by output_one_frame_from_dpb(), and write_lost_non_ref_pic().

Here is the call graph for this function:

void write_unpaired_field ( FrameStore *  fs,
int  p_out 
)


Documentation generated with DoxyGen