void (*vp8_short_idct4x4_1)(short *input, short *output, int pitch);
void (*vp8_dc_only_idct)(short input_dc, short *output, int pitch);
-extern void (*vp9_post_proc_down_and_across)(
- unsigned char *src_ptr,
- unsigned char *dst_ptr,
- int src_pixels_per_line,
- int dst_pixels_per_line,
- int rows,
- int cols,
- int flimit
-);
-
-extern void (*vp9_mbpost_proc_down)(unsigned char *dst, int pitch, int rows, int cols, int flimit);
-extern void vp9_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, int flimit);
-extern void (*vp9_mbpost_proc_across_ip)(unsigned char *src, int pitch, int rows, int cols, int flimit);
-extern void vp9_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int cols, int flimit);
-
-extern void vp9_post_proc_down_and_across_c
-(
- unsigned char *src_ptr,
- unsigned char *dst_ptr,
- int src_pixels_per_line,
- int dst_pixels_per_line,
- int rows,
- int cols,
- int flimit
-);
-void vp9_plane_add_noise_c(unsigned char *Start, unsigned int Width, unsigned int Height, int Pitch, int q, int a);
+extern void (*vp9_post_proc_down_and_across)(unsigned char *src_ptr,
+ unsigned char *dst_ptr,
+ int src_pixels_per_line,
+ int dst_pixels_per_line,
+ int rows, int cols, int flimit);
+
+extern void (*vp9_mbpost_proc_down)(unsigned char *dst, int pitch,
+ int rows, int cols, int flimit);
+extern void vp9_mbpost_proc_down_c(unsigned char *dst, int pitch,
+ int rows, int cols, int flimit);
+extern void (*vp9_mbpost_proc_across_ip)(unsigned char *src, int pitch,
+ int rows, int cols, int flimit);
+extern void vp9_mbpost_proc_across_ip_c(unsigned char *src, int pitch,
+ int rows, int cols, int flimit);
+extern void vp9_post_proc_down_and_across_c(unsigned char *src_ptr,
+ unsigned char *dst_ptr,
+ int src_pixels_per_line,
+ int dst_pixels_per_line,
+ int rows, int cols, int flimit);
+void vp9_plane_add_noise_c(unsigned char *start,
+ unsigned int width, unsigned int height,
+ int pitch, int q, int a);
extern copy_mem_block_function *vp9_copy_mem16x16;
extern copy_mem_block_function *vp9_copy_mem8x8;
extern copy_mem_block_function copy_mem16x16_ppc;
-void recon_b_ppc(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
-void recon2b_ppc(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
-void recon4b_ppc(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
+void recon_b_ppc(short *diff_ptr, unsigned char *pred_ptr,
+ unsigned char *dst_ptr, int stride);
+void recon2b_ppc(short *diff_ptr, unsigned char *pred_ptr,
+ unsigned char *dst_ptr, int stride);
+void recon4b_ppc(short *diff_ptr, unsigned char *pred_ptr,
+ unsigned char *dst_ptr, int stride);
extern void short_idct4x4_ppc(short *input, short *output, int pitch);
extern copy_mem_block_function vp9_copy_mem8x8_c;
extern copy_mem_block_function vp9_copy_mem8x4_c;
-void vp9_recon_b_c(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
-void vp9_recon2b_c(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
-void vp9_recon4b_c(short *diff_ptr, unsigned char *pred_ptr, unsigned char *dst_ptr, int stride);
+void vp9_recon_b_c(short *diff_ptr, unsigned char *pred_ptr,
+ unsigned char *dst_ptr, int stride);
+void vp9_recon2b_c(short *diff_ptr, unsigned char *pred_ptr,
+ unsigned char *dst_ptr, int stride);
+void vp9_recon4b_c(short *diff_ptr, unsigned char *pred_ptr,
+ unsigned char *dst_ptr, int stride);
extern void vp9_short_idct4x4_1_c(short *input, short *output, int pitch);
extern void vp9_short_idct4x4_c(short *input, short *output, int pitch);
}
typedef struct {
- int Version; // 4 versions of bitstream defined 0 best quality/slowest decode, 3 lowest quality/fastest decode
- int Width; // width of data passed to the compressor
- int Height; // height of data passed to the compressor
+ int version; // 4 versions of bitstream defined:
+ // 0 - best quality/slowest decode,
+ // 3 - lowest quality/fastest decode
+ int width; // width of data passed to the compressor
+ int height; // height of data passed to the compressor
double frame_rate; // set to passed in framerate
int64_t target_bandwidth; // bandwidth to be used in kilobits per second
DECLARE_ALIGNED(16, int16_t, Y1dequant[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, int16_t, UVdequant[QINDEX_RANGE][16]);
- int Width;
- int Height;
+ int width;
+ int height;
int display_width;
int display_height;
int last_width;
*
* INPUTS : unsigned char *Start starting address of buffer to
* add gaussian noise to
- * unsigned int Width width of plane
- * unsigned int Height height of plane
- * int Pitch distance between subsequent lines of frame
+ * unsigned int width width of plane
+ * unsigned int height height of plane
+ * int pitch distance between subsequent lines of frame
* int q quantizer used to determine amount of noise
* to add
*
* SPECIAL NOTES : None.
*
****************************************************************************/
-void vp9_plane_add_noise_c(uint8_t *Start, char *noise,
+void vp9_plane_add_noise_c(uint8_t *start, char *noise,
char blackclamp[16],
char whiteclamp[16],
char bothclamp[16],
- unsigned int Width, unsigned int Height, int Pitch) {
+ unsigned int width, unsigned int height, int pitch) {
unsigned int i, j;
- for (i = 0; i < Height; i++) {
- uint8_t *Pos = Start + i * Pitch;
- char *Ref = (char *)(noise + (rand() & 0xff));
+ for (i = 0; i < height; i++) {
+ uint8_t *pos = start + i * pitch;
+ char *ref = (char *)(noise + (rand() & 0xff)); // NOLINT
- for (j = 0; j < Width; j++) {
- if (Pos[j] < blackclamp[0])
- Pos[j] = blackclamp[0];
+ for (j = 0; j < width; j++) {
+ if (pos[j] < blackclamp[0])
+ pos[j] = blackclamp[0];
- if (Pos[j] > 255 + whiteclamp[0])
- Pos[j] = 255 + whiteclamp[0];
+ if (pos[j] > 255 + whiteclamp[0])
+ pos[j] = 255 + whiteclamp[0];
- Pos[j] += Ref[j];
+ pos[j] += ref[j];
}
}
}
*dest = *oci->frame_to_show;
/* handle problem with extending borders */
- dest->y_width = oci->Width;
- dest->y_height = oci->Height;
+ dest->y_width = oci->width;
+ dest->y_height = oci->height;
dest->uv_height = dest->y_height / 2;
return 0;
*dest = oci->post_proc_buffer;
/* handle problem with extending borders */
- dest->y_width = oci->Width;
- dest->y_height = oci->Height;
+ dest->y_width = oci->width;
+ dest->y_height = oci->height;
dest->uv_height = dest->y_height / 2;
return 0;
vp9_setup_scale_factors_for_frame(&cm->active_ref_scale[i],
&cm->yv12_fb[cm->active_ref_idx[i]],
- cm->Width, cm->Height);
+ cm->width, cm->height);
}
if (xd->mode_info_context) {
%undef flimit2
-;void vp9_plane_add_noise_mmx (unsigned char *Start, unsigned char *noise,
+;void vp9_plane_add_noise_mmx (unsigned char *start, unsigned char *noise,
; unsigned char blackclamp[16],
; unsigned char whiteclamp[16],
; unsigned char bothclamp[16],
-; unsigned int Width, unsigned int Height, int Pitch)
+; unsigned int width, unsigned int height, int pitch)
extern sym(rand)
global sym(vp9_plane_add_noise_mmx) PRIVATE
sym(vp9_plane_add_noise_mmx):
%undef flimit4
-;void vp9_plane_add_noise_wmt (unsigned char *Start, unsigned char *noise,
+;void vp9_plane_add_noise_wmt (unsigned char *start, unsigned char *noise,
; unsigned char blackclamp[16],
; unsigned char whiteclamp[16],
; unsigned char bothclamp[16],
-; unsigned int Width, unsigned int Height, int Pitch)
+; unsigned int width, unsigned int height, int pitch)
extern sym(rand)
global sym(vp9_plane_add_noise_wmt) PRIVATE
sym(vp9_plane_add_noise_wmt):
int_mv *const mv = &mbmi->mv[0];
const int mb_size = 1 << mi->mbmi.sb_type;
- const int use_prev_in_find_mv_refs = cm->Width == cm->last_width &&
- cm->Height == cm->last_height &&
+ const int use_prev_in_find_mv_refs = cm->width == cm->last_width &&
+ cm->height == cm->last_height &&
!cm->error_resilient_mode;
int mb_to_left_edge;
VP9_COMMON *cm = &pbi->common;
/* our internal buffers are always multiples of 16 */
- const int width = (cm->Width + 15) & ~15;
- const int height = (cm->Height + 15) & ~15;
+ const int width = (cm->width + 15) & ~15;
+ const int height = (cm->height + 15) & ~15;
cm->mb_rows = height >> 4;
cm->mb_cols = width >> 4;
data += 3;
}
{
- const int width = pc->Width;
- const int height = pc->Height;
+ const int width = pc->width;
+ const int height = pc->height;
/* If error concealment is enabled we should only parse the new size
* if we have enough data. Otherwise we will end up with the wrong
data += 4;
}
if (data + 4 < data_end) {
- pc->Width = read_le16(data + 0);
- pc->Height = read_le16(data + 2);
+ pc->width = read_le16(data + 0);
+ pc->height = read_le16(data + 2);
data += 4;
}
if (!scaling_active) {
- pc->display_width = pc->Width;
- pc->display_height = pc->Height;
+ pc->display_width = pc->width;
+ pc->display_height = pc->height;
}
- if (width != pc->Width || height != pc->Height) {
- if (pc->Width <= 0) {
- pc->Width = width;
+ if (width != pc->width || height != pc->height) {
+ if (pc->width <= 0) {
+ pc->width = width;
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
"Invalid frame width");
}
- if (pc->Height <= 0) {
- pc->Height = height;
+ if (pc->height <= 0) {
+ pc->height = height;
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
"Invalid frame height");
}
if (!pbi->initial_width || !pbi->initial_height) {
- if (vp9_alloc_frame_buffers(pc, pc->Width, pc->Height))
+ if (vp9_alloc_frame_buffers(pc, pc->width, pc->height))
vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
"Failed to allocate frame buffers");
- pbi->initial_width = pc->Width;
- pbi->initial_height = pc->Height;
+ pbi->initial_width = pc->width;
+ pbi->initial_height = pc->height;
}
- if (pc->Width > pbi->initial_width) {
+ if (pc->width > pbi->initial_width) {
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
"Frame width too large");
}
- if (pc->Height > pbi->initial_height) {
+ if (pc->height > pbi->initial_height) {
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
"Frame height too large");
}
}
if ((!pbi->decoded_key_frame && pc->frame_type != KEY_FRAME) ||
- pc->Width == 0 || pc->Height == 0) {
+ pc->width == 0 || pc->height == 0) {
return -1;
}
/* Reset the frame pointers to the current frame size */
vp8_yv12_realloc_frame_buffer(&pc->yv12_fb[pc->new_fb_idx],
- pc->Width, pc->Height,
+ pc->width, pc->height,
VP9BORDERINPIXELS);
if (vp9_start_decode(&header_bc, data,
corrupt_tokens |= xd->corrupted;
// keep track of the last coded dimensions
- pc->last_width = pc->Width;
- pc->last_height = pc->Height;
+ pc->last_width = pc->width;
+ pc->last_height = pc->height;
// Collect information about decoder corruption.
// 1. Check first boolean decoder for errors.
#if WRITE_RECON_BUFFER == 1
if (cm->show_frame)
recon_write_yuv_frame("recon.yuv", cm->frame_to_show,
- cm->Width, cm->Height);
+ cm->width, cm->height);
#endif
vp9_clear_system_state();
if (pbi->common.frame_to_show) {
*sd = *pbi->common.frame_to_show;
- sd->y_width = pbi->common.Width;
- sd->y_height = pbi->common.Height;
- sd->uv_height = pbi->common.Height / 2;
+ sd->y_width = pbi->common.width;
+ sd->y_height = pbi->common.height;
+ sd->uv_height = pbi->common.height / 2;
ret = 0;
} else {
ret = -1;
{
int v;
- if (pc->Width != pc->display_width || pc->Height != pc->display_height) {
+ if (pc->width != pc->display_width || pc->height != pc->display_height) {
v = pc->display_width;
cx_data[0] = v;
cx_data[1] = v >> 8;
extra_bytes_packed += 4;
}
- v = pc->Width;
+ v = pc->width;
cx_data[0] = v;
cx_data[1] = v >> 8;
- v = pc->Height;
+ v = pc->height;
cx_data[2] = v;
cx_data[3] = v >> 8;
/* update frame tag */
{
- int scaling = (pc->Width != pc->display_width
- || pc->Height != pc->display_height);
+ int scaling = (pc->width != pc->display_width ||
+ pc->height != pc->display_height);
int v = (oh.first_partition_length_in_bytes << 8) |
(scaling << 5) |
(oh.show_frame << 4) |
int new_mv_mode_penalty = 256;
int sr = 0;
- int quart_frm = MIN(cpi->common.Width, cpi->common.Height);
+ int quart_frm = MIN(cpi->common.width, cpi->common.height);
// refine the motion search range accroding to the frame dimension
// for first pass test
}
static void alloc_raw_frame_buffers(VP9_COMP *cpi) {
- cpi->lookahead = vp9_lookahead_init(cpi->oxcf.Width, cpi->oxcf.Height,
+ cpi->lookahead = vp9_lookahead_init(cpi->oxcf.width, cpi->oxcf.height,
cpi->oxcf.lag_in_frames);
if (!cpi->lookahead)
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
#if VP9_TEMPORAL_ALT_REF
if (vp8_yv12_alloc_frame_buffer(&cpi->alt_ref_buffer,
- cpi->oxcf.Width, cpi->oxcf.Height,
+ cpi->oxcf.width, cpi->oxcf.height,
VP9BORDERINPIXELS))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate altref buffer");
void vp9_alloc_compressor_data(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
- if (vp9_alloc_frame_buffers(cm, cm->Width, cm->Height))
+ if (vp9_alloc_frame_buffers(cm, cm->width, cm->height))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate frame buffers");
"Failed to allocate partition data");
if (vp8_yv12_alloc_frame_buffer(&cpi->last_frame_uf,
- cm->Width, cm->Height, VP9BORDERINPIXELS))
+ cm->width, cm->height, VP9BORDERINPIXELS))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate last frame buffer");
if (vp8_yv12_alloc_frame_buffer(&cpi->scaled_source,
- cm->Width, cm->Height, VP9BORDERINPIXELS))
+ cm->width, cm->height, VP9BORDERINPIXELS))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate scaled source buffer");
VP9_COMMON *cm = &cpi->common;
/* our internal buffers are always multiples of 16 */
- int aligned_width = (cm->Width + 15) & ~15;
- int aligned_height = (cm->Height + 15) & ~15;
+ int aligned_width = (cm->width + 15) & ~15;
+ int aligned_height = (cm->height + 15) & ~15;
cm->mb_rows = aligned_height >> 4;
cm->mb_cols = aligned_width >> 4;
/* Update size of buffers local to this frame */
if (vp8_yv12_realloc_frame_buffer(&cpi->last_frame_uf,
- cm->Width, cm->Height, VP9BORDERINPIXELS))
+ cm->width, cm->height, VP9BORDERINPIXELS))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to reallocate last frame buffer");
if (vp8_yv12_realloc_frame_buffer(&cpi->scaled_source,
- cm->Width, cm->Height, VP9BORDERINPIXELS))
+ cm->width, cm->height, VP9BORDERINPIXELS))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to reallocate scaled source buffer");
cpi->goldfreq = 7;
- cm->version = oxcf->Version;
+ cm->version = oxcf->version;
vp9_setup_version(cm);
- cm->Width = oxcf->Width;
- cm->Height = oxcf->Height;
+ cm->width = oxcf->width;
+ cm->height = oxcf->height;
// change includes all joint functionality
vp9_change_config(ptr, oxcf);
if (!oxcf)
return;
- if (cm->version != oxcf->Version) {
- cm->version = oxcf->Version;
+ if (cm->version != oxcf->version) {
+ cm->version = oxcf->version;
vp9_setup_version(cm);
}
cpi->target_bandwidth = cpi->oxcf.target_bandwidth;
- cm->display_width = cpi->oxcf.Width;
- cm->display_height = cpi->oxcf.Height;
+ cm->display_width = cpi->oxcf.width;
+ cm->display_height = cpi->oxcf.height;
// VP8 sharpness level mapping 0-7 (vs 0-10 in general VPx dialogs)
if (cpi->oxcf.Sharpness > 7)
if (!cpi->initial_width) {
alloc_raw_frame_buffers(cpi);
vp9_alloc_compressor_data(cpi);
- cpi->initial_width = cm->Width;
- cpi->initial_height = cm->Height;
+ cpi->initial_width = cm->width;
+ cpi->initial_height = cm->height;
}
- assert(cm->Width <= cpi->initial_width);
- assert(cm->Height <= cpi->initial_height);
+ assert(cm->width <= cpi->initial_width);
+ assert(cm->height <= cpi->initial_height);
update_frame_size(cpi);
if (cpi->oxcf.fixed_q >= 0) {
struct vpx_codec_cx_pkt pkt;
uint64_t sse;
int i;
- unsigned int width = cpi->common.Width;
- unsigned int height = cpi->common.Height;
+ unsigned int width = cpi->common.width;
+ unsigned int height = cpi->common.height;
pkt.kind = VPX_CODEC_PSNR_PKT;
sse = calc_plane_error(orig->y_buffer, orig->y_stride,
void vp9_write_yuv_rec_frame(VP9_COMMON *cm) {
YV12_BUFFER_CONFIG *s = cm->frame_to_show;
uint8_t *src = s->y_buffer;
- int h = cm->Height;
+ int h = cm->height;
do {
fwrite(src, s->y_width, 1, yuv_rec_file);
} while (--h);
src = s->u_buffer;
- h = (cm->Height + 1) / 2;
+ h = (cm->height + 1) / 2;
do {
fwrite(src, s->uv_width, 1, yuv_rec_file);
} while (--h);
src = s->v_buffer;
- h = (cm->Height + 1) / 2;
+ h = (cm->height + 1) / 2;
do {
fwrite(src, s->uv_width, 1, yuv_rec_file);
for (i = 0; i < 3; i++) {
YV12_BUFFER_CONFIG *ref = &cm->yv12_fb[cm->ref_frame_map[i]];
- if (ref->y_crop_width != cm->Width ||
- ref->y_crop_height != cm->Height) {
+ if (ref->y_crop_width != cm->width ||
+ ref->y_crop_height != cm->height) {
int new_fb = get_free_fb(cm);
vp8_yv12_realloc_frame_buffer(&cm->yv12_fb[new_fb],
- cm->Width, cm->Height,
+ cm->width, cm->height,
VP9BORDERINPIXELS);
scale_and_extend_frame(ref, &cm->yv12_fb[new_fb]);
cpi->scaled_ref_idx[i] = new_fb;
xd->mode_ref_lf_delta_update = 0;
// keep track of the last coded dimensions
- cm->last_width = cm->Width;
- cm->last_height = cm->Height;
+ cm->last_width = cm->width;
+ cm->last_height = cm->height;
// Dont increment frame counters if this was an altref buffer update not a real frame
if (cm->show_frame) {
/* Reset the frame pointers to the current frame size */
vp8_yv12_realloc_frame_buffer(&cm->yv12_fb[cm->new_fb_idx],
- cm->Width, cm->Height,
+ cm->width, cm->height,
VP9BORDERINPIXELS);
vp9_setup_interp_filters(&cpi->mb.e_mbd, DEFAULT_INTERP_FILTER, cm);
if (cpi->common.frame_to_show) {
*dest = *cpi->common.frame_to_show;
- dest->y_width = cpi->common.Width;
- dest->y_height = cpi->common.Height;
- dest->uv_height = cpi->common.Height / 2;
+ dest->y_width = cpi->common.width;
+ dest->y_height = cpi->common.height;
+ dest->uv_height = cpi->common.height / 2;
ret = 0;
} else {
ret = -1;
Scale2Ratio(vert_mode, &vr, &vs);
// always go to the next whole number
- cm->Width = (hs - 1 + cpi->oxcf.Width * hr) / hs;
- cm->Height = (vs - 1 + cpi->oxcf.Height * vr) / vs;
+ cm->width = (hs - 1 + cpi->oxcf.width * hr) / hs;
+ cm->height = (vs - 1 + cpi->oxcf.height * vr) / vs;
- assert(cm->Width <= cpi->initial_width);
- assert(cm->Height <= cpi->initial_height);
+ assert(cm->width <= cpi->initial_width);
+ assert(cm->height <= cpi->initial_height);
update_frame_size(cpi);
return 0;
}
&scale[frame_type], &scale[frame_type]);
// Gets an initial list of candidate vectors from neighbours and orders them
- use_prev_in_find_mv_refs = cm->Width == cm->last_width &&
- cm->Height == cm->last_height &&
+ use_prev_in_find_mv_refs = cm->width == cm->last_width &&
+ cm->height == cm->last_height &&
!cpi->common.error_resilient_mode;
vp9_find_mv_refs(&cpi->common, xd, xd->mode_info_context,
use_prev_in_find_mv_refs ? xd->prev_mode_info_context : NULL,
vp9_clamp_mv_min_max(x, &ref_mv[0]);
- sr = vp9_init_search_range(cpi->common.Width, cpi->common.Height);
+ sr = vp9_init_search_range(cpi->common.width, cpi->common.height);
// mvp_full.as_int = ref_mv[0].as_int;
mvp_full.as_int =
// Setup scaling factors. Scaling on each of the arnr frames is not supported
vp9_setup_scale_factors_for_frame(&cpi->mb.e_mbd.scale_factor[0],
&cpi->common.yv12_fb[cpi->common.new_fb_idx],
- cpi->common.Width,
- cpi->common.Height);
+ cpi->common.width,
+ cpi->common.height);
cpi->mb.e_mbd.scale_factor_uv[0] = cpi->mb.e_mbd.scale_factor[0];
// Setup frame pointers, NULL indicates frame not included in filter
static vpx_codec_err_t set_vp8e_config(VP9_CONFIG *oxcf,
vpx_codec_enc_cfg_t cfg,
struct vp8_extracfg vp8_cfg) {
- oxcf->Version = cfg.g_profile;
- oxcf->Version |= vp8_cfg.experimental ? 0x4 : 0;
-
- oxcf->Width = cfg.g_w;
- oxcf->Height = cfg.g_h;
+ oxcf->version = cfg.g_profile | (vp8_cfg.experimental ? 0x4 : 0);
+ oxcf->width = cfg.g_w;
+ oxcf->height = cfg.g_h;
/* guess a frame rate if out of whack, use 30 */
oxcf->frame_rate = (double)(cfg.g_timebase.den) / (double)(cfg.g_timebase.num);