Commit 1c8ec1fe authored by Ken Martin's avatar Ken Martin
Browse files

ENH: moved onto 18 branch

parent c4da2a3f
PROJECT(MPEG2ENC)
# We need ansi c-flags, especially on HP
SET(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
SET(CMAKE_REQUIRED_FLAGS ${CMAKE_ANSI_CFLAGS})
SET(srcs
conform.c motion.c putbits.c putpic.c quantize.c stats.c
fdctref.c puthdr.c putseq.c ratectl.c transfrm.c
idct.c predict.c putmpg.c putvlc.c readpic.c writepic.c
vtkMPEG2WriterHelper.cxx
)
INCLUDE_DIRECTORIES(
${VTK_INCLUDE_DIR}
)
ADD_LIBRARY(vtkMPEG2Encode ${srcs})
TARGET_LINK_LIBRARIES(vtkMPEG2Encode vtkIO vtkImaging)
/* config.h, configuration defines */
/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
/*
* Disclaimer of Warranty
*
* These software programs are available to the user without any license fee or
* royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
* any and all warranties, whether express, implied, or statuary, including any
* implied warranties or merchantability or of fitness for a particular
* purpose. In no event shall the copyright-holder be liable for any
* incidental, punitive, or consequential damages of any kind whatsoever
* arising from the use of these programs.
*
* This disclaimer of warranty extends to the user of these programs and user's
* customers, employees, agents, transferees, successors, and assigns.
*
* The MPEG Software Simulation Group does not represent or warrant that the
* programs furnished hereunder are free of infringement of any third-party
* patents.
*
* Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
* are subject to royalty fees to patent holders. Many of these patents are
* general enough such that they are unavoidable regardless of implementation
* design.
*
*/
/* define NON_ANSI_COMPILER for compilers without function prototyping */
/* #define NON_ANSI_COMPILER */
#ifdef NON_ANSI_COMPILER
#define _ANSI_ARGS_(x) ()
#else
#define _ANSI_ARGS_(x) x
#endif
/* conform.c, conformance checks */
/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
/*
* Disclaimer of Warranty
*
* These software programs are available to the user without any license fee or
* royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
* any and all warranties, whether express, implied, or statuary, including any
* implied warranties or merchantability or of fitness for a particular
* purpose. In no event shall the copyright-holder be liable for any
* incidental, punitive, or consequential damages of any kind whatsoever
* arising from the use of these programs.
*
* This disclaimer of warranty extends to the user of these programs and user's
* customers, employees, agents, transferees, successors, and assigns.
*
* The MPEG Software Simulation Group does not represent or warrant that the
* programs furnished hereunder are free of infringement of any third-party
* patents.
*
* Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
* are subject to royalty fees to patent holders. Many of these patents are
* general enough such that they are unavoidable regardless of implementation
* design.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
#include "global.h"
/* check for (level independent) parameter limits */
void MPEG2_range_checks()
{
int i;
/* range and value checks */
if (vtkMPEG2WriterStr->horizontal_size<1 || vtkMPEG2WriterStr->horizontal_size>16383)
MPEG2_error("horizontal_size must be between 1 and 16383");
if (vtkMPEG2WriterStr->mpeg1 && vtkMPEG2WriterStr->horizontal_size>4095)
MPEG2_error("horizontal_size must be less than 4096 (MPEG-1)");
if ((vtkMPEG2WriterStr->horizontal_size&4095)==0)
MPEG2_error("horizontal_size must not be a multiple of 4096");
if (vtkMPEG2WriterStr->chroma_format!=CHROMA444 && vtkMPEG2WriterStr->horizontal_size%2 != 0)
MPEG2_error("horizontal_size must be a even (4:2:0 / 4:2:2)");
if (vtkMPEG2WriterStr->vertical_size<1 || vtkMPEG2WriterStr->vertical_size>16383)
MPEG2_error("vertical_size must be between 1 and 16383");
if (vtkMPEG2WriterStr->mpeg1 && vtkMPEG2WriterStr->vertical_size>4095)
MPEG2_error("vertical size must be less than 4096 (MPEG-1)");
if ((vtkMPEG2WriterStr->vertical_size&4095)==0)
MPEG2_error("vertical_size must not be a multiple of 4096");
if (vtkMPEG2WriterStr->chroma_format==CHROMA420 && vtkMPEG2WriterStr->vertical_size%2 != 0)
MPEG2_error("vertical_size must be a even (4:2:0)");
if(vtkMPEG2WriterStr->fieldpic)
{
if (vtkMPEG2WriterStr->vertical_size%2 != 0)
MPEG2_error("vertical_size must be a even (field pictures)");
if (vtkMPEG2WriterStr->chroma_format==CHROMA420 && vtkMPEG2WriterStr->vertical_size%4 != 0)
MPEG2_error("vertical_size must be a multiple of 4 (4:2:0 field pictures)");
}
if (vtkMPEG2WriterStr->mpeg1)
{
if (vtkMPEG2WriterStr->aspectratio<1 || vtkMPEG2WriterStr->aspectratio>14)
MPEG2_error("pel_aspect_ratio must be between 1 and 14 (MPEG-1)");
}
else
{
if (vtkMPEG2WriterStr->aspectratio<1 || vtkMPEG2WriterStr->aspectratio>4)
MPEG2_error("aspect_ratio_information must be 1, 2, 3 or 4");
}
if (vtkMPEG2WriterStr->frame_rate_code<1 || vtkMPEG2WriterStr->frame_rate_code>8)
MPEG2_error("frame_rate code must be between 1 and 8");
if (vtkMPEG2WriterStr->bit_rate<=0.0)
MPEG2_error("bit_rate must be positive");
if (vtkMPEG2WriterStr->bit_rate > ((1<<30)-1)*400.0)
MPEG2_error("bit_rate must be less than 429 Gbit/s");
if (vtkMPEG2WriterStr->mpeg1 && vtkMPEG2WriterStr->bit_rate > ((1<<18)-1)*400.0)
MPEG2_error("bit_rate must be less than 104 Mbit/s (MPEG-1)");
if (vtkMPEG2WriterStr->vbv_buffer_size<1 || vtkMPEG2WriterStr->vbv_buffer_size>0x3ffff)
MPEG2_error("vbv_buffer_size must be in range 1..(2^18-1)");
if (vtkMPEG2WriterStr->mpeg1 && vtkMPEG2WriterStr->vbv_buffer_size>=1024)
MPEG2_error("vbv_buffer_size must be less than 1024 (MPEG-1)");
if (vtkMPEG2WriterStr->chroma_format<CHROMA420 || vtkMPEG2WriterStr->chroma_format>CHROMA444)
MPEG2_error("chroma_format must be in range 1...3");
if (vtkMPEG2WriterStr->video_format<0 || vtkMPEG2WriterStr->video_format>4)
MPEG2_error("video_format must be in range 0...4");
if (vtkMPEG2WriterStr->color_primaries<1 || vtkMPEG2WriterStr->color_primaries>7 || vtkMPEG2WriterStr->color_primaries==3)
MPEG2_error("color_primaries must be in range 1...2 or 4...7");
if (vtkMPEG2WriterStr->transfer_characteristics<1 || vtkMPEG2WriterStr->transfer_characteristics>7
|| vtkMPEG2WriterStr->transfer_characteristics==3)
MPEG2_error("transfer_characteristics must be in range 1...2 or 4...7");
if (vtkMPEG2WriterStr->matrix_coefficients<1 || vtkMPEG2WriterStr->matrix_coefficients>7 || vtkMPEG2WriterStr->matrix_coefficients==3)
MPEG2_error("matrix_coefficients must be in range 1...2 or 4...7");
if (vtkMPEG2WriterStr->display_horizontal_size<0 || vtkMPEG2WriterStr->display_horizontal_size>16383)
MPEG2_error("display_horizontal_size must be in range 0...16383");
if (vtkMPEG2WriterStr->display_vertical_size<0 || vtkMPEG2WriterStr->display_vertical_size>16383)
MPEG2_error("display_vertical_size must be in range 0...16383");
if (vtkMPEG2WriterStr->dc_prec<0 || vtkMPEG2WriterStr->dc_prec>3)
MPEG2_error("intra_dc_precision must be in range 0...3");
for (i=0; i<vtkMPEG2WriterStr->M_val; i++)
{
if (vtkMPEG2WriterStr->motion_data[i].forw_hor_f_code<1 || vtkMPEG2WriterStr->motion_data[i].forw_hor_f_code>9)
MPEG2_error("f_code must be between 1 and 9");
if (vtkMPEG2WriterStr->motion_data[i].forw_vert_f_code<1 || vtkMPEG2WriterStr->motion_data[i].forw_vert_f_code>9)
MPEG2_error("f_code must be between 1 and 9");
if (vtkMPEG2WriterStr->mpeg1 && vtkMPEG2WriterStr->motion_data[i].forw_hor_f_code>7)
MPEG2_error("f_code must be le less than 8");
if (vtkMPEG2WriterStr->mpeg1 && vtkMPEG2WriterStr->motion_data[i].forw_vert_f_code>7)
MPEG2_error("f_code must be le less than 8");
if (vtkMPEG2WriterStr->motion_data[i].sxf<=0)
MPEG2_error("search window must be positive"); /* doesn't belong here */
if (vtkMPEG2WriterStr->motion_data[i].syf<=0)
MPEG2_error("search window must be positive");
if (i!=0)
{
if (vtkMPEG2WriterStr->motion_data[i].back_hor_f_code<1 || vtkMPEG2WriterStr->motion_data[i].back_hor_f_code>9)
MPEG2_error("f_code must be between 1 and 9");
if (vtkMPEG2WriterStr->motion_data[i].back_vert_f_code<1 || vtkMPEG2WriterStr->motion_data[i].back_vert_f_code>9)
MPEG2_error("f_code must be between 1 and 9");
if (vtkMPEG2WriterStr->mpeg1 && vtkMPEG2WriterStr->motion_data[i].back_hor_f_code>7)
MPEG2_error("f_code must be le less than 8");
if (vtkMPEG2WriterStr->mpeg1 && vtkMPEG2WriterStr->motion_data[i].back_vert_f_code>7)
MPEG2_error("f_code must be le less than 8");
if (vtkMPEG2WriterStr->motion_data[i].sxb<=0)
MPEG2_error("search window must be positive");
if (vtkMPEG2WriterStr->motion_data[i].syb<=0)
MPEG2_error("search window must be positive");
}
}
}
/* identifies valid profile / level combinations */
static char profile_level_defined[5][4] =
{
/* HL H-14 ML LL */
{1, 1, 1, 0}, /* HP */
{0, 1, 0, 0}, /* Spat */
{0, 0, 1, 1}, /* SNR */
{1, 1, 1, 1}, /* MP */
{0, 0, 1, 0} /* SP */
};
static struct level_limits {
int hor_f_code;
int vert_f_code;
int hor_size;
int vert_size;
int sample_rate;
int bit_rate; /* Mbit/s */
int vbv_buffer_size; /* 16384 bit steps */
} maxval_tab[4] =
{
{9, 5, 1920, 1152, 62668800, 80, 597}, /* HL */
{9, 5, 1440, 1152, 47001600, 60, 448}, /* H-14 */
{8, 5, 720, 576, 10368000, 15, 112}, /* ML */
{7, 4, 352, 288, 3041280, 4, 29} /* LL */
};
#define SP 5
#define MP 4
#define SNR 3
#define SPAT 2
#define HP 1
#define LL 10
#define ML 8
#define H14 6
#define HL 4
void MPEG2_profile_and_level_checks()
{
int i;
struct level_limits *maxval;
if (vtkMPEG2WriterStr->profile<0 || vtkMPEG2WriterStr->profile>15)
MPEG2_error("profile must be between 0 and 15");
if (vtkMPEG2WriterStr->level<0 || vtkMPEG2WriterStr->level>15)
MPEG2_error("level must be between 0 and 15");
if (vtkMPEG2WriterStr->profile>=8)
{
if (!vtkMPEG2WriterStr->quiet)
fprintf(stderr,"Warning: profile uses a reserved value, conformance checks skipped\n");
return;
}
if (vtkMPEG2WriterStr->profile<HP || vtkMPEG2WriterStr->profile>SP)
MPEG2_error("undefined Profile");
if (vtkMPEG2WriterStr->profile==SNR || vtkMPEG2WriterStr->profile==SPAT)
MPEG2_error("This encoder currently generates no scalable bitstreams");
if (vtkMPEG2WriterStr->level<HL || vtkMPEG2WriterStr->level>LL || vtkMPEG2WriterStr->level&1)
MPEG2_error("undefined Level");
maxval = &maxval_tab[(vtkMPEG2WriterStr->level-4) >> 1];
/* check profile@level combination */
if(!profile_level_defined[vtkMPEG2WriterStr->profile-1][(vtkMPEG2WriterStr->level-4) >> 1])
MPEG2_error("undefined profile@level combination");
/* profile (syntax) constraints */
if (vtkMPEG2WriterStr->profile==SP && vtkMPEG2WriterStr->M_val!=1)
MPEG2_error("Simple Profile does not allow B pictures");
if (vtkMPEG2WriterStr->profile!=HP && vtkMPEG2WriterStr->chroma_format!=CHROMA420)
MPEG2_error("chroma format must be 4:2:0 in specified Profile");
if (vtkMPEG2WriterStr->profile==HP && vtkMPEG2WriterStr->chroma_format==CHROMA444)
MPEG2_error("chroma format must be 4:2:0 or 4:2:2 in High Profile");
if (vtkMPEG2WriterStr->profile>=MP) /* SP, MP: constrained repeat_first_field */
{
if (vtkMPEG2WriterStr->frame_rate_code<=2 && vtkMPEG2WriterStr->repeatfirst)
MPEG2_error("repeat_first_first must be zero");
if (vtkMPEG2WriterStr->frame_rate_code<=6 && vtkMPEG2WriterStr->prog_seq && vtkMPEG2WriterStr->repeatfirst)
MPEG2_error("repeat_first_first must be zero");
}
if (vtkMPEG2WriterStr->profile!=HP && vtkMPEG2WriterStr->dc_prec==3)
MPEG2_error("11 bit DC precision only allowed in High Profile");
/* level (parameter value) constraints */
/* Table 8-8 */
if (vtkMPEG2WriterStr->frame_rate_code>5 && vtkMPEG2WriterStr->level>=ML)
MPEG2_error("Picture rate greater than permitted in specified Level");
for (i=0; i<vtkMPEG2WriterStr->M_val; i++)
{
if (vtkMPEG2WriterStr->motion_data[i].forw_hor_f_code > maxval->hor_f_code)
MPEG2_error("forward horizontal f_code greater than permitted in specified Level");
if (vtkMPEG2WriterStr->motion_data[i].forw_vert_f_code > maxval->vert_f_code)
MPEG2_error("forward vertical f_code greater than permitted in specified Level");
if (i!=0)
{
if (vtkMPEG2WriterStr->motion_data[i].back_hor_f_code > maxval->hor_f_code)
MPEG2_error("backward horizontal f_code greater than permitted in specified Level");
if (vtkMPEG2WriterStr->motion_data[i].back_vert_f_code > maxval->vert_f_code)
MPEG2_error("backward vertical f_code greater than permitted in specified Level");
}
}
/* Table 8-10 */
if (vtkMPEG2WriterStr->horizontal_size > maxval->hor_size)
MPEG2_error("Horizontal size is greater than permitted in specified Level");
if (vtkMPEG2WriterStr->vertical_size > maxval->vert_size)
MPEG2_error("Horizontal size is greater than permitted in specified Level");
/* Table 8-11 */
if (vtkMPEG2WriterStr->horizontal_size*vtkMPEG2WriterStr->vertical_size*vtkMPEG2WriterStr->frame_rate > maxval->sample_rate)
MPEG2_error("Sample rate is greater than permitted in specified Level");
/* Table 8-12 */
if (vtkMPEG2WriterStr->bit_rate> 1.0e6 * maxval->bit_rate)
MPEG2_error("Bit rate is greater than permitted in specified Level");
/* Table 8-13 */
if (vtkMPEG2WriterStr->vbv_buffer_size > maxval->vbv_buffer_size)
MPEG2_error("vbv_buffer_size exceeds High Level limit");
}
/* fdctref.c, forward discrete cosine transform, double precision */
/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
/*
* Disclaimer of Warranty
*
* These software programs are available to the user without any license fee or
* royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
* any and all warranties, whether express, implied, or statuary, including any
* implied warranties or merchantability or of fitness for a particular
* purpose. In no event shall the copyright-holder be liable for any
* incidental, punitive, or consequential damages of any kind whatsoever
* arising from the use of these programs.
*
* This disclaimer of warranty extends to the user of these programs and user's
* customers, employees, agents, transferees, successors, and assigns.
*
* The MPEG Software Simulation Group does not represent or warrant that the
* programs furnished hereunder are free of infringement of any third-party
* patents.
*
* Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
* are subject to royalty fees to patent holders. Many of these patents are
* general enough such that they are unavoidable regardless of implementation
* design.
*
*/
#include <math.h>
#include "config.h"
#ifndef PI
# ifdef M_PI
# define PI M_PI
# else
# define PI 3.14159265358979323846
# endif
#endif
/* global declarations */
void MPEG2_init_fdct _ANSI_ARGS_((void));
void MPEG2_fdct _ANSI_ARGS_((short *block));
/* private data */
static double c[8][8]; /* transform coefficients */
void MPEG2_init_fdct()
{
int i, j;
double s;
for (i=0; i<8; i++)
{
s = (i==0) ? sqrt(0.125) : 0.5;
for (j=0; j<8; j++)
c[i][j] = s * cos((PI/8.0)*i*(j+0.5));
}
}
void MPEG2_fdct(block)
short *block;
{
int i, j, k;
double s;
double tmp[64];
for (i=0; i<8; i++)
for (j=0; j<8; j++)
{
s = 0.0;
for (k=0; k<8; k++)
s += c[j][k] * block[8*i+k];
tmp[8*i+j] = s;
}
for (j=0; j<8; j++)
for (i=0; i<8; i++)
{
s = 0.0;
for (k=0; k<8; k++)
s += c[i][k] * tmp[8*k+j];
block[8*i+j] = (int)floor(s+0.499999);
/*
* reason for adding 0.499999 instead of 0.5:
* s is quite often x.5 (at least for i and/or j = 0 or 4)
* and setting the rounding threshold exactly to 0.5 leads to an
* extremely high arithmetic implementation dependency of the result;
* s being between x.5 and x.500001 (which is now incorrectly rounded
* downwards instead of upwards) is assumed to occur less often
* (if at all)
*/
}
}
/* global.h, global variables, function prototypes */
/* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
/*
* Disclaimer of Warranty
*
* These software programs are available to the user without any license fee or
* royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
* any and all warranties, whether express, implied, or statuary, including any
* implied warranties or merchantability or of fitness for a particular
* purpose. In no event shall the copyright-holder be liable for any
* incidental, punitive, or consequential damages of any kind whatsoever
* arising from the use of these programs.
*
* This disclaimer of warranty extends to the user of these programs and user's
* customers, employees, agents, transferees, successors, and assigns.
*
* The MPEG Software Simulation Group does not represent or warrant that the
* programs furnished hereunder are free of infringement of any third-party
* patents.
*
* Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
* are subject to royalty fees to patent holders. Many of these patents are
* general enough such that they are unavoidable regardless of implementation
* design.
*
*/
#ifdef __cplusplus
extern "C" {
#endif
#include "mpeg2enc.h"
/* choose between declaration (GLOBAL undefined)
* and definition (GLOBAL defined)
* GLOBAL is defined in exactly one file (mpeg2enc.c)
*/
#ifndef GLOBAL
#define EXTERN extern
#else
#define EXTERN
#endif
/* prototypes of global functions */
/* conform.c */
void MPEG2_range_checks _ANSI_ARGS_((void));
void MPEG2_profile_and_level_checks _ANSI_ARGS_(());
/* fdctref.c */
void MPEG2_init_fdct _ANSI_ARGS_((void));
void MPEG2_fdct _ANSI_ARGS_((short *block));
/* idct.c */
void MPEG2_idct _ANSI_ARGS_((short *block));
void MPEG2_init_idct _ANSI_ARGS_((void));
/* motion.c */
void MPEG2_motion_estimation _ANSI_ARGS_((unsigned char *oldorg, unsigned char *neworg,
unsigned char *oldref, unsigned char *newref, unsigned char *cur,
unsigned char *curref, int sxf, int syf, int sxb, int syb,
struct mbinfo *mbi, int secondfield, int ipflag));
/* mpeg2enc.c */
void MPEG2_error _ANSI_ARGS_((const char *text));
/* predict.c */
void MPEG2_predict _ANSI_ARGS_((unsigned char *reff[], unsigned char *refb[],
unsigned char *cur[3], int secondfield, struct mbinfo *mbi));
/* putbits.c */
void MPEG2_initbits _ANSI_ARGS_((void));
void MPEG2_putbits _ANSI_ARGS_((int val, int n));
void MPEG2_alignbits _ANSI_ARGS_((void));
int MPEG2_bitcount _ANSI_ARGS_((void));
/* puthdr.c */
void MPEG2_putseqhdr _ANSI_ARGS_((void));
void MPEG2_putseqext _ANSI_ARGS_((void));
void MPEG2_putseqdispext _ANSI_ARGS_((void));
void MPEG2_putuserdata _ANSI_ARGS_((char *userdata));
void MPEG2_putgophdr _ANSI_ARGS_((int frame, int closed_gop));
void MPEG2_putpicthdr _ANSI_ARGS_((void));
void MPEG2_putpictcodext _ANSI_ARGS_((void));
void MPEG2_putseqend _ANSI_ARGS_((void));
/* putmpg.c */
void MPEG2_putintrablk _ANSI_ARGS_((short *blk, int cc));
void MPEG2_putnonintrablk _ANSI_ARGS_((short *blk));
void MPEG2_putmv _ANSI_ARGS_((int dmv, int f_code));
/* putpic.c */
void MPEG2_putpict _ANSI_ARGS_((unsigned char *frame));
/* putseq.c */
int MPEG2_putseq_one _ANSI_ARGS_((int cframe, int max));
/* putvlc.c */
void MPEG2_putDClum _ANSI_ARGS_((int val));
void MPEG2_putDCchrom _ANSI_ARGS_((int val));
void MPEG2_putACfirst _ANSI_ARGS_((int run, int val));
void MPEG2_putAC _ANSI_ARGS_((int run, int signed_level, int vlcformat));
void MPEG2_putaddrinc _ANSI_ARGS_((int addrinc));
void MPEG2_putmbtype _ANSI_ARGS_((int pict_type, int mb_type));
void MPEG2_putmotioncode _ANSI_ARGS_((int motion_code));
void MPEG2_putdmv _ANSI_ARGS_((int dmv));
void MPEG2_putcbp _ANSI_ARGS_((int cbp));
/* quantize.c */
int MPEG2_quant_intra _ANSI_ARGS_((short *src, short *dst, int dc_prec,
unsigned char *quant_mat, int mquant));
int MPEG2_quant_non_intra _ANSI_ARGS_((short *src, short *dst,
unsigned char *quant_mat, int mquant));
void MPEG2_iquant_intra _ANSI_ARGS_((short *src, short *dst, int dc_prec,
unsigned char *quant_mat, int mquant));
void MPEG2_iquant_non_intra _ANSI_ARGS_((short *src, short *dst,
unsigned char *quant_mat, int mquant));
/* ratectl.c */
void MPEG2_rc_init_seq _ANSI_ARGS_((void));
void MPEG2_rc_init_GOP _ANSI_ARGS_((int np, int nb));
void MPEG2_rc_init_pict _ANSI_ARGS_((unsigned char *frame));
void MPEG2_rc_update_pict _ANSI_ARGS_((void));
int MPEG2_rc_start_mb _ANSI_ARGS_((void));
int MPEG2_rc_calc_mquant _ANSI_ARGS_((int j));
void MPEG2_vbv_end_of_picture _ANSI_ARGS_((void));
void MPEG2_calc_vbv_delay _ANSI_ARGS_((void));
/* readpic.c */
void MPEG2_readframe _ANSI_ARGS_((char *fname, unsigned char *frame[]));
unsigned char* vtkMPEG2WriterInternalGetImagePtr _ANSI_ARGS_((const char* fname));
/* stats.c */
void MPEG2_calcSNR _ANSI_ARGS_((unsigned char *org[3], unsigned char *rec[3]));
void MPEG2_stats _ANSI_ARGS_((void));
/* transfrm.c */
void MPEG2_transform _ANSI_ARGS_((unsigned char *pred[], unsigned char *cur[],
struct mbinfo *mbi, short blocks[][64]));
void MPEG2_itransform _ANSI_ARGS_((unsigned char *pred[], unsigned char *cur[],
struct mbinfo *mbi, short blocks[][64]));
void MPEG2_dct_type_estimation _ANSI_ARGS_((unsigned char *pred, unsigned char *cur,
struct mbinfo *mbi));
/* writepic.c */
void MPEG2_writeframe _ANSI_ARGS_((char *fname, unsigned char *frame[]));
/* global variables */
EXTERN char MPEG2_version[]
#ifdef GLOBAL
="mpeg2encode V1.2, 96/07/19"
#endif
;
EXTERN char MPEG2_author[]
#ifdef GLOBAL
="(C) 1996, MPEG Software Simulation Group"
#endif
<