Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.2:Update
schroedinger
schroedinger-strict-aliasing.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File schroedinger-strict-aliasing.patch of Package schroedinger
commit 7831a506bc6714b3db40e31584e61ccaa71d78d9 Author: David Schleef <ds@schleef.org> Date: Wed Jun 3 11:39:46 2009 -0700 motion: merge SchroMotionVectorDC into SchroMotionVector Fixes a bunch of compiler aliasing issues. diff --git a/schroedinger/schrodecoder.c b/schroedinger/schrodecoder.c index 4a2e803..485addb 100644 --- a/schroedinger/schrodecoder.c +++ b/schroedinger/schrodecoder.c @@ -2515,29 +2515,28 @@ schro_decoder_decode_prediction_unit(SchroPicture *picture, SchroArith **arith, if (mv->pred_mode == 0) { int pred[3]; - SchroMotionVectorDC *mvdc = (SchroMotionVectorDC *)mv; schro_motion_dc_prediction (motion, x, y, pred); if (!params->is_noarith) { - mvdc->dc[0] = pred[0] + _schro_arith_decode_sint ( + mv->u.dc.dc[0] = pred[0] + _schro_arith_decode_sint ( arith[SCHRO_DECODER_ARITH_DC_0], SCHRO_CTX_LUMA_DC_CONT_BIN1, SCHRO_CTX_LUMA_DC_VALUE, SCHRO_CTX_LUMA_DC_SIGN); - mvdc->dc[1] = pred[1] + _schro_arith_decode_sint ( + mv->u.dc.dc[1] = pred[1] + _schro_arith_decode_sint ( arith[SCHRO_DECODER_ARITH_DC_1], SCHRO_CTX_CHROMA1_DC_CONT_BIN1, SCHRO_CTX_CHROMA1_DC_VALUE, SCHRO_CTX_CHROMA1_DC_SIGN); - mvdc->dc[2] = pred[2] + _schro_arith_decode_sint ( + mv->u.dc.dc[2] = pred[2] + _schro_arith_decode_sint ( arith[SCHRO_DECODER_ARITH_DC_2], SCHRO_CTX_CHROMA2_DC_CONT_BIN1, SCHRO_CTX_CHROMA2_DC_VALUE, SCHRO_CTX_CHROMA2_DC_SIGN); } else { - mvdc->dc[0] = pred[0] + + mv->u.dc.dc[0] = pred[0] + schro_unpack_decode_sint (unpack + SCHRO_DECODER_ARITH_DC_0); - mvdc->dc[1] = pred[1] + + mv->u.dc.dc[1] = pred[1] + schro_unpack_decode_sint (unpack + SCHRO_DECODER_ARITH_DC_1); - mvdc->dc[2] = pred[2] + + mv->u.dc.dc[2] = pred[2] + schro_unpack_decode_sint (unpack + SCHRO_DECODER_ARITH_DC_2); } } else { @@ -2562,18 +2561,18 @@ schro_decoder_decode_prediction_unit(SchroPicture *picture, SchroArith **arith, &pred_x, &pred_y, 1); if (!params->is_noarith) { - mv->dx[0] = pred_x + _schro_arith_decode_sint ( + mv->u.vec.dx[0] = pred_x + _schro_arith_decode_sint ( arith[SCHRO_DECODER_ARITH_VECTOR_REF1_X], SCHRO_CTX_MV_REF1_H_CONT_BIN1, SCHRO_CTX_MV_REF1_H_VALUE, SCHRO_CTX_MV_REF1_H_SIGN); - mv->dy[0] = pred_y + _schro_arith_decode_sint ( + mv->u.vec.dy[0] = pred_y + _schro_arith_decode_sint ( arith[SCHRO_DECODER_ARITH_VECTOR_REF1_Y], SCHRO_CTX_MV_REF1_V_CONT_BIN1, SCHRO_CTX_MV_REF1_V_VALUE, SCHRO_CTX_MV_REF1_V_SIGN); } else { - mv->dx[0] = pred_x + schro_unpack_decode_sint ( + mv->u.vec.dx[0] = pred_x + schro_unpack_decode_sint ( unpack + SCHRO_DECODER_ARITH_VECTOR_REF1_X); - mv->dy[0] = pred_y + schro_unpack_decode_sint ( + mv->u.vec.dy[0] = pred_y + schro_unpack_decode_sint ( unpack + SCHRO_DECODER_ARITH_VECTOR_REF1_Y); } } @@ -2582,26 +2581,26 @@ schro_decoder_decode_prediction_unit(SchroPicture *picture, SchroArith **arith, &pred_x, &pred_y, 2); if (!params->is_noarith) { - mv->dx[1] = pred_x + _schro_arith_decode_sint ( + mv->u.vec.dx[1] = pred_x + _schro_arith_decode_sint ( arith[SCHRO_DECODER_ARITH_VECTOR_REF2_X], SCHRO_CTX_MV_REF2_H_CONT_BIN1, SCHRO_CTX_MV_REF2_H_VALUE, SCHRO_CTX_MV_REF2_H_SIGN); - mv->dy[1] = pred_y + _schro_arith_decode_sint ( + mv->u.vec.dy[1] = pred_y + _schro_arith_decode_sint ( arith[SCHRO_DECODER_ARITH_VECTOR_REF2_Y], SCHRO_CTX_MV_REF2_V_CONT_BIN1, SCHRO_CTX_MV_REF2_V_VALUE, SCHRO_CTX_MV_REF2_V_SIGN); } else { - mv->dx[1] = pred_x + schro_unpack_decode_sint ( + mv->u.vec.dx[1] = pred_x + schro_unpack_decode_sint ( unpack + SCHRO_DECODER_ARITH_VECTOR_REF2_X); - mv->dy[1] = pred_y + schro_unpack_decode_sint ( + mv->u.vec.dy[1] = pred_y + schro_unpack_decode_sint ( unpack + SCHRO_DECODER_ARITH_VECTOR_REF2_Y); } } } else { - mv->dx[0] = 0; - mv->dy[0] = 0; - mv->dx[1] = 0; - mv->dy[1] = 0; + mv->u.vec.dx[0] = 0; + mv->u.vec.dy[0] = 0; + mv->u.vec.dx[1] = 0; + mv->u.vec.dy[1] = 0; } } } diff --git a/schroedinger/schroencoder.c b/schroedinger/schroencoder.c index 7c92bcb..6265745 100644 --- a/schroedinger/schroencoder.c +++ b/schroedinger/schroencoder.c @@ -1931,8 +1931,8 @@ schro_encoder_encode_vector_data (SchroEncoderFrame *frame, int ref, int xy) if ((mv->pred_mode&(1<<ref)) && !mv->using_global) { schro_motion_vector_prediction (frame->motion, i+k, j+l, &pred_x, &pred_y, 1<<ref); - x = mv->dx[ref]; - y = mv->dy[ref]; + x = mv->u.vec.dx[ref]; + y = mv->u.vec.dy[ref]; if (!params->is_noarith) { if (xy == 0) { @@ -1999,7 +1999,6 @@ schro_encoder_encode_dc_data (SchroEncoderFrame *frame, int comp) if (mv->pred_mode == 0) { int pred[3]; - SchroMotionVectorDC *mvdc = (SchroMotionVectorDC *)mv; schro_motion_dc_prediction (frame->motion, i+k, j+l, pred); @@ -2009,25 +2008,25 @@ schro_encoder_encode_dc_data (SchroEncoderFrame *frame, int comp) _schro_arith_encode_sint (arith, SCHRO_CTX_LUMA_DC_CONT_BIN1, SCHRO_CTX_LUMA_DC_VALUE, SCHRO_CTX_LUMA_DC_SIGN, - mvdc->dc[0] - pred[0]); + mv->u.dc.dc[0] - pred[0]); break; case 1: _schro_arith_encode_sint (arith, SCHRO_CTX_CHROMA1_DC_CONT_BIN1, SCHRO_CTX_CHROMA1_DC_VALUE, SCHRO_CTX_CHROMA1_DC_SIGN, - mvdc->dc[1] - pred[1]); + mv->u.dc.dc[1] - pred[1]); break; case 2: _schro_arith_encode_sint (arith, SCHRO_CTX_CHROMA2_DC_CONT_BIN1, SCHRO_CTX_CHROMA2_DC_VALUE, SCHRO_CTX_CHROMA2_DC_SIGN, - mvdc->dc[2] - pred[2]); + mv->u.dc.dc[2] - pred[2]); break; default: SCHRO_ASSERT(0); } } else { - schro_pack_encode_sint (pack, mvdc->dc[comp] - pred[comp]); + schro_pack_encode_sint (pack, mv->u.dc.dc[comp] - pred[comp]); } } } diff --git a/schroedinger/schroglobalest.c b/schroedinger/schroglobalest.c index 67608ea..1ac8e6d 100644 --- a/schroedinger/schroglobalest.c +++ b/schroedinger/schroglobalest.c @@ -48,8 +48,8 @@ schro_motion_global_metric (SchroMotionField *field, SchroFrame *frame, for(i=0;i<field->x_num_blocks;i++){ mv = field->motion_vectors + j*field->x_num_blocks + i; - x = i*8 + mv->dx[ref]; - y = j*8 + mv->dy[ref]; + x = i*8 + mv->u.vec.dx[ref]; + y = j*8 + mv->u.vec.dy[ref]; #if 0 mv->metric = schro_metric_absdiff_u8 ( frame->components[0].data + x + y*frame->components[0].stride, @@ -111,8 +111,8 @@ schro_motion_field_global_estimation (SchroMotionField *mf, for(i=0;i<mf->x_num_blocks;i++) { mv = mf->motion_vectors + j*mf->x_num_blocks + i; if (mv->using_global) { - m_f += mv->dx[ref]; - m_g += mv->dy[ref]; + m_f += mv->u.vec.dx[ref]; + m_g += mv->u.vec.dy[ref]; m_x += i*xbsep; m_y += j*ybsep; n++; @@ -137,10 +137,10 @@ schro_motion_field_global_estimation (SchroMotionField *mf, for(i=0;i<mf->x_num_blocks;i++) { mv = mf->motion_vectors + j*mf->x_num_blocks + i; if (mv->using_global) { - m_fx += (mv->dx[ref] - pan_x) * (i*xbsep - ave_x); - m_fy += (mv->dx[ref] - pan_x) * (j*ybsep - ave_y); - m_gx += (mv->dy[ref] - pan_y) * (i*xbsep - ave_x); - m_gy += (mv->dy[ref] - pan_y) * (j*ybsep - ave_y); + m_fx += (mv->u.vec.dx[ref] - pan_x) * (i*xbsep - ave_x); + m_fy += (mv->u.vec.dx[ref] - pan_x) * (j*ybsep - ave_y); + m_gx += (mv->u.vec.dy[ref] - pan_y) * (i*xbsep - ave_x); + m_gy += (mv->u.vec.dy[ref] - pan_y) * (j*ybsep - ave_y); m_xx += (i*xbsep - ave_x) * (i*xbsep - ave_x); m_yy += (j*ybsep - ave_y) * (j*ybsep - ave_y); n++; @@ -164,8 +164,8 @@ schro_motion_field_global_estimation (SchroMotionField *mf, mv = mf->motion_vectors + j*mf->x_num_blocks + i; if (mv->using_global) { double dx, dy; - dx = mv->dx[ref] - (pan_x + a00 * i + a01 * j); - dy = mv->dy[ref] - (pan_y + a10 * i + a11 * j); + dx = mv->u.vec.dx[ref] - (pan_x + a00 * i + a01 * j); + dy = mv->u.vec.dy[ref] - (pan_y + a10 * i + a11 * j); sum2 += dx * dx + dy * dy; } } @@ -181,8 +181,8 @@ schro_motion_field_global_estimation (SchroMotionField *mf, for(i=0;i<mf->x_num_blocks;i++) { double dx, dy; mv = mf->motion_vectors + j*mf->x_num_blocks + i; - dx = mv->dx[ref] - (pan_x + a00 * i + a01 * j); - dy = mv->dy[ref] - (pan_y + a10 * i + a11 * j); + dx = mv->u.vec.dx[ref] - (pan_x + a00 * i + a01 * j); + dy = mv->u.vec.dy[ref] - (pan_y + a10 * i + a11 * j); mv->using_global = (dx * dx + dy * dy < stddev2*16); n += mv->using_global; } @@ -211,10 +211,10 @@ schro_motion_field_global_estimation (SchroMotionField *mf, for(i=0;i<mf->x_num_blocks;i++) { mv = mf->motion_vectors + j*mf->x_num_blocks + i; mv->using_global = 1; - //mv->dx[ref] = gm->b0 + ((gm->a00 * (i*8) + gm->a01 * (j*8))>>gm->a_exp) - i*8; - //mv->dy[ref] = gm->b1 + ((gm->a10 * (i*8) + gm->a11 * (j*8))>>gm->a_exp) - j*8; - mv->dx[ref] = 0; - mv->dy[ref] = 0; + //mv->u.vec.dx[ref] = gm->b0 + ((gm->a00 * (i*8) + gm->a01 * (j*8))>>gm->a_exp) - i*8; + //mv->u.vec.dy[ref] = gm->b1 + ((gm->a10 * (i*8) + gm->a11 * (j*8))>>gm->a_exp) - j*8; + mv->u.vec.dx[ref] = 0; + mv->u.vec.dy[ref] = 0; } } } @@ -229,8 +229,8 @@ schro_motionest_superblock_global (SchroMotionEst *me, int ref, mv->split = 0; mv->pred_mode = 1<<ref; mv->using_global = 1; - mv->dx[ref] = 0; - mv->dy[ref] = 0; + mv->u.vec.dx[ref] = 0; + mv->u.vec.dy[ref] = 0; //block->error = schro_motionest_superblock_get_metric (me, block, i, j); block->error = (ref==1) ? -1000 : 1000; block->entropy = 0; diff --git a/schroedinger/schromotion.c b/schroedinger/schromotion.c index b7fcbdb..0a6ff63 100644 --- a/schroedinger/schromotion.c +++ b/schroedinger/schromotion.c @@ -93,12 +93,11 @@ static int get_dc_pixel (SchroMotion *motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; - SchroMotionVectorDC *mvdc; + SchroMotionVector *mv; - mvdc = (SchroMotionVectorDC *) - &motion->motion_vectors[j*params->x_num_blocks + i]; + mv = &motion->motion_vectors[j*params->x_num_blocks + i]; - return mvdc->dc[k] + 128; + return mv->u.dc.dc[k] + 128; } static int @@ -113,8 +112,8 @@ get_ref1_pixel (SchroMotion *motion, int i, int j, int k, int x, int y) if (mv->using_global) { schro_motion_get_global_vector (motion, 0, x, y, &dx, &dy); } else { - dx = mv->dx[0]; - dy = mv->dy[0]; + dx = mv->u.vec.dx[0]; + dy = mv->u.vec.dy[0]; } value = (motion->ref1_weight + motion->ref2_weight) * @@ -135,8 +134,8 @@ get_ref2_pixel (SchroMotion *motion, int i, int j, int k, int x, int y) if (mv->using_global) { schro_motion_get_global_vector (motion, 1, x, y, &dx, &dy); } else { - dx = mv->dx[1]; - dy = mv->dy[1]; + dx = mv->u.vec.dx[1]; + dy = mv->u.vec.dy[1]; } value = (motion->ref1_weight + motion->ref2_weight) * @@ -158,10 +157,10 @@ get_biref_pixel (SchroMotion *motion, int i, int j, int k, int x, int y) schro_motion_get_global_vector (motion, 0, x, y, &dx0, &dy0); schro_motion_get_global_vector (motion, 1, x, y, &dx1, &dy1); } else { - dx0 = mv->dx[0]; - dy0 = mv->dy[0]; - dx1 = mv->dx[1]; - dy1 = mv->dy[1]; + dx0 = mv->u.vec.dx[0]; + dy0 = mv->u.vec.dy[0]; + dx1 = mv->u.vec.dx[1]; + dy1 = mv->u.vec.dy[1]; } value = motion->ref1_weight * @@ -312,15 +311,14 @@ static void get_dc_block (SchroMotion *motion, int i, int j, int k, int x, int y) { SchroParams *params = motion->params; - SchroMotionVectorDC *mvdc; + SchroMotionVector *mv; int value; int ii, jj; - mvdc = (SchroMotionVectorDC *) - &motion->motion_vectors[j*params->x_num_blocks + i]; + mv = &motion->motion_vectors[j*params->x_num_blocks + i]; memcpy (&motion->block, &motion->alloc_block, sizeof(SchroFrameData)); - value = mvdc->dc[k]; + value = mv->u.dc.dc[k]; for(jj=0;jj<motion->yblen;jj++) { uint8_t *data = SCHRO_FRAME_DATA_GET_LINE (&motion->block, jj); /* FIXME splat */ @@ -342,7 +340,7 @@ get_ref1_block (SchroMotion *motion, int i, int j, int k, int x, int y) mv = &motion->motion_vectors[j*params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); - get_block (motion, k, 0, i, j, mv->dx[0], mv->dy[0]); + get_block (motion, k, 0, i, j, mv->u.vec.dx[0], mv->u.vec.dy[0]); weight = motion->ref1_weight + motion->ref2_weight; shift = motion->ref_weight_precision; @@ -375,7 +373,7 @@ get_ref2_block (SchroMotion *motion, int i, int j, int k, int x, int y) mv = &motion->motion_vectors[j*params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); - get_block (motion, k, 1, i, j, mv->dx[1], mv->dy[1]); + get_block (motion, k, 1, i, j, mv->u.vec.dx[1], mv->u.vec.dy[1]); weight = motion->ref1_weight + motion->ref2_weight; shift = motion->ref_weight_precision; @@ -408,8 +406,8 @@ get_biref_block (SchroMotion *motion, int i, int j, int k, int x, int y) mv = &motion->motion_vectors[j*params->x_num_blocks + i]; SCHRO_ASSERT (mv->using_global == FALSE); - get_block (motion, k, 0, i, j, mv->dx[0], mv->dy[0]); - get_block (motion, k, 1, i, j, mv->dx[1], mv->dy[1]); + get_block (motion, k, 0, i, j, mv->u.vec.dx[0], mv->u.vec.dy[0]); + get_block (motion, k, 1, i, j, mv->u.vec.dx[1], mv->u.vec.dy[1]); weight0 = motion->ref1_weight; weight1 = motion->ref2_weight; @@ -870,7 +868,7 @@ schro_motion_render (SchroMotion *motion, SchroFrame *dest) void schro_motion_dc_prediction (SchroMotion *motion, int x, int y, int *pred) { - SchroMotionVectorDC *mvdc; + SchroMotionVector *mv; int i; for(i=0;i<3;i++){ @@ -878,23 +876,23 @@ schro_motion_dc_prediction (SchroMotion *motion, int x, int y, int *pred) int n = 0; if (x>0) { - mvdc = SCHRO_MOTION_GET_DC_BLOCK(motion,x-1,y); - if (mvdc->pred_mode == 0) { - sum += mvdc->dc[i]; + mv = SCHRO_MOTION_GET_BLOCK(motion,x-1,y); + if (mv->pred_mode == 0) { + sum += mv->u.dc.dc[i]; n++; } } if (y>0) { - mvdc = SCHRO_MOTION_GET_DC_BLOCK(motion,x,y-1); - if (mvdc->pred_mode == 0) { - sum += mvdc->dc[i]; + mv = SCHRO_MOTION_GET_BLOCK(motion,x,y-1); + if (mv->pred_mode == 0) { + sum += mv->u.dc.dc[i]; n++; } } if (x>0 && y>0) { - mvdc = SCHRO_MOTION_GET_DC_BLOCK(motion,x-1,y-1); - if (mvdc->pred_mode == 0) { - sum += mvdc->dc[i]; + mv = SCHRO_MOTION_GET_BLOCK(motion,x-1,y-1); + if (mv->pred_mode == 0) { + sum += mv->u.dc.dc[i]; n++; } } @@ -974,24 +972,24 @@ schro_motion_vector_prediction (SchroMotion *motion, if (x>0) { mv = SCHRO_MOTION_GET_BLOCK(motion,x-1,y); if (mv->using_global == FALSE && (mv->pred_mode & mode)) { - vx[n] = mv->dx[mode-1]; - vy[n] = mv->dy[mode-1]; + vx[n] = mv->u.vec.dx[mode-1]; + vy[n] = mv->u.vec.dy[mode-1]; n++; } } if (y>0) { mv = SCHRO_MOTION_GET_BLOCK(motion,x,y-1); if (mv->using_global == FALSE && (mv->pred_mode & mode)) { - vx[n] = mv->dx[mode-1]; - vy[n] = mv->dy[mode-1]; + vx[n] = mv->u.vec.dx[mode-1]; + vy[n] = mv->u.vec.dy[mode-1]; n++; } } if (x>0 && y>0) { mv = SCHRO_MOTION_GET_BLOCK(motion,x-1,y-1); if (mv->using_global == FALSE && (mv->pred_mode & mode)) { - vx[n] = mv->dx[mode-1]; - vy[n] = mv->dy[mode-1]; + vx[n] = mv->u.vec.dx[mode-1]; + vy[n] = mv->u.vec.dy[mode-1]; n++; } } @@ -1132,14 +1130,13 @@ schro_motion_verify (SchroMotion *motion) switch (mv->pred_mode) { case 0: { - SchroMotionVectorDC *mvdc = (SchroMotionVectorDC *)mv; int i; for(i=0;i<3;i++){ /* FIXME 8bit */ - if (mvdc->dc[i] < -128 || mvdc->dc[i] > 127) { + if (mv->u.dc.dc[i] < -128 || mv->u.dc.dc[i] > 127) { SCHRO_ERROR("mv(%d,%d) has bad DC value [%d] %d", x, y, - i, mvdc->dc[i]); + i, mv->u.dc.dc[i]); return 0; } } diff --git a/schroedinger/schromotion.h b/schroedinger/schromotion.h index abe5a1b..9fde83a 100644 --- a/schroedinger/schromotion.h +++ b/schroedinger/schromotion.h @@ -21,19 +21,15 @@ struct _SchroMotionVector { unsigned int unused : 3; unsigned int scan : 8; unsigned int metric : 16; - int16_t dx[2]; - int16_t dy[2]; -}; - -struct _SchroMotionVectorDC { - unsigned int pred_mode : 2; - unsigned int using_global : 1; - unsigned int split : 2; - unsigned int unused : 3; - unsigned int scan : 8; - unsigned int metric : 16; - int16_t dc[3]; - uint16_t _padding1; + union { + struct { + int16_t dx[2]; + int16_t dy[2]; + } vec; + struct { + int16_t dc[3]; + } dc; + } u; }; struct _SchroMotionField { @@ -78,8 +74,6 @@ struct _SchroMotion { #define SCHRO_MOTION_GET_BLOCK(motion,x,y) \ ((motion)->motion_vectors+(y)*(motion)->params->x_num_blocks + (x)) -#define SCHRO_MOTION_GET_DC_BLOCK(motion,x,y) \ - ((SchroMotionVectorDC *)SCHRO_MOTION_GET_BLOCK(motion,x,y)) SchroMotion * schro_motion_new (SchroParams *params, SchroUpsampledFrame *ref1, SchroUpsampledFrame *ref2); diff --git a/schroedinger/schromotionest.c b/schroedinger/schromotionest.c index aec43ef..f973302 100644 --- a/schroedinger/schromotionest.c +++ b/schroedinger/schromotionest.c @@ -154,12 +154,12 @@ schro_encoder_motion_refine_block_subpel (SchroEncoderFrame *frame, for(jj=0;jj<4;jj+=skip){ for(ii=0;ii<4;ii+=skip){ if (block->mv[jj][ii].pred_mode & 1) { - block->mv[jj][ii].dx[0] <<= params->mv_precision; - block->mv[jj][ii].dy[0] <<= params->mv_precision; + block->mv[jj][ii].u.vec.dx[0] <<= params->mv_precision; + block->mv[jj][ii].u.vec.dy[0] <<= params->mv_precision; } if (block->mv[jj][ii].pred_mode & 2) { - block->mv[jj][ii].dx[1] <<= params->mv_precision; - block->mv[jj][ii].dy[1] <<= params->mv_precision; + block->mv[jj][ii].u.vec.dx[1] <<= params->mv_precision; + block->mv[jj][ii].u.vec.dy[1] <<= params->mv_precision; } } } @@ -195,8 +195,8 @@ schro_encoder_motion_refine_block_subpel (SchroEncoderFrame *frame, for(dx=-1;dx<=1;dx++) { for(dy=-1;dy<=1;dy++) { schro_upsampled_frame_get_subdata_prec1 (ref_upframe, 0, - 2*x + block->mv[jj][ii].dx[ref] + dx, - 2*y + block->mv[jj][ii].dy[ref] + dy, + 2*x + block->mv[jj][ii].u.vec.dx[ref] + dx, + 2*y + block->mv[jj][ii].u.vec.dy[ref] + dy, &ref_fd); metric = schro_metric_get (&orig, &ref_fd, width, height); @@ -207,8 +207,8 @@ schro_encoder_motion_refine_block_subpel (SchroEncoderFrame *frame, } } } - block->mv[ii][ii].dx[ref] += min_dx; - block->mv[jj][ii].dy[ref] += min_dy; + block->mv[ii][ii].u.vec.dx[ref] += min_dx; + block->mv[jj][ii].u.vec.dy[ref] += min_dy; block->error = metric; } } @@ -353,7 +353,7 @@ schro_motion_field_dump (SchroMotionField *field) for(j=0;j<field->y_num_blocks;j++){ for(i=0;i<field->x_num_blocks;i++){ mv = field->motion_vectors + j*field->x_num_blocks + i; - printf("%d %d %d %d\n", i, j, mv->dx[0], mv->dy[0]); + printf("%d %d %d %d\n", i, j, mv->u.vec.dx[0], mv->u.vec.dy[0]); } } exit(0); @@ -437,13 +437,13 @@ schro_motionest_superblock_scan_one (SchroMotionEst *me, int ref, int distance, mv = &block->mv[0][0]; hint_mv = motion_field_get (hint_mf, i, j); - dx = hint_mv->dx[ref]; - dy = hint_mv->dy[ref]; + dx = hint_mv->u.vec.dx[ref]; + dy = hint_mv->u.vec.dy[ref]; schro_metric_scan_setup (&scan, dx, dy, distance); if (scan.scan_width <= 0 || scan.scan_height <= 0) { - mv->dx[ref] = 0; - mv->dy[ref] = 0; + mv->u.vec.dx[ref] = 0; + mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; block->valid = FALSE; return; @@ -456,8 +456,8 @@ schro_motionest_superblock_scan_one (SchroMotionEst *me, int ref, int distance, mv->split = 0; mv->pred_mode = 1<<ref; mv->using_global = 0; - mv->dx[ref] = dx; - mv->dy[ref] = dy; + mv->u.vec.dx[ref] = dx; + mv->u.vec.dy[ref] = dy; schro_block_fixup (block); block->entropy = schro_motion_superblock_try_estimate_entropy (me->motion, @@ -478,8 +478,8 @@ schro_motionest_superblock_predicted (SchroMotionEst *me, int ref, mv->split = 0; mv->pred_mode = 1<<ref; mv->using_global = 0; - mv->dx[ref] = pred_x; - mv->dy[ref] = pred_y; + mv->u.vec.dx[ref] = pred_x; + mv->u.vec.dy[ref] = pred_y; block->error = schro_motionest_superblock_get_metric (me, block, i, j); block->entropy = 0; schro_block_fixup (block); @@ -497,10 +497,10 @@ schro_motionest_superblock_biref_zero (SchroMotionEst *me, mv->split = 0; mv->pred_mode = 3; mv->using_global = 0; - mv->dx[0] = 0; - mv->dy[0] = 0; - mv->dx[1] = 0; - mv->dy[1] = 0; + mv->u.vec.dx[0] = 0; + mv->u.vec.dy[0] = 0; + mv->u.vec.dx[1] = 0; + mv->u.vec.dy[1] = 0; block->error = schro_motionest_superblock_get_metric (me, block, i, j); schro_block_fixup (block); block->entropy = schro_motion_superblock_try_estimate_entropy (me->motion, @@ -513,18 +513,18 @@ schro_motionest_superblock_dc (SchroMotionEst *me, SchroBlock *block, int i, int j) { SchroParams *params = me->params; - SchroMotionVectorDC *mvdc; + SchroMotionVector *mv; int chroma_w, chroma_h; SchroFrame *frame; int metric; frame = get_downsampled (me->encoder_frame, 0); - mvdc = (SchroMotionVectorDC *)&block->mv[0][0]; - mvdc->split = 0; - mvdc->pred_mode = 0; + mv = &block->mv[0][0]; + mv->split = 0; + mv->pred_mode = 0; - metric = schro_block_average (&mvdc->dc[0], frame->components + 0, + metric = schro_block_average (&mv->u.dc.dc[0], frame->components + 0, i * params->xbsep_luma, j * params->ybsep_luma, 4 * params->xbsep_luma, 4 * params->ybsep_luma); if (metric == SCHRO_METRIC_INVALID_2) { @@ -533,12 +533,12 @@ schro_motionest_superblock_dc (SchroMotionEst *me, } chroma_w = params->xbsep_luma>>SCHRO_CHROMA_FORMAT_H_SHIFT(params->video_format->chroma_format); chroma_h = params->ybsep_luma>>SCHRO_CHROMA_FORMAT_V_SHIFT(params->video_format->chroma_format); - schro_block_average (&mvdc->dc[1], frame->components + 1, + schro_block_average (&mv->u.dc.dc[1], frame->components + 1, i * chroma_w, j * chroma_h, 4 * chroma_w, 4 * chroma_h); - schro_block_average (&mvdc->dc[2], frame->components + 2, + schro_block_average (&mv->u.dc.dc[2], frame->components + 2, i * chroma_w, j * chroma_h, 4 * chroma_w, 4 * chroma_h); - mvdc->metric = metric/16; + mv->metric = metric/16; block->error = metric; /* FIXME magic parameter */ block->error += 4 * 2 * me->params->xbsep_luma * 10; @@ -554,22 +554,22 @@ static void schro_motionest_superblock_dc_predicted (SchroMotionEst *me, SchroBlock *block, int i, int j) { - SchroMotionVectorDC *mvdc; + SchroMotionVector *mv; int pred[3]; schro_motion_dc_prediction (me->motion, i, j, pred); - mvdc = (SchroMotionVectorDC *)&block->mv[0][0]; - mvdc->split = 0; - mvdc->pred_mode = 0; - mvdc->dc[0] = pred[0]; - mvdc->dc[1] = pred[1]; - mvdc->dc[2] = pred[2]; + mv = &block->mv[0][0]; + mv->split = 0; + mv->pred_mode = 0; + mv->u.dc.dc[0] = pred[0]; + mv->u.dc.dc[1] = pred[1]; + mv->u.dc.dc[2] = pred[2]; block->error = schro_motionest_superblock_get_metric (me, block, i, j); /* FIXME magic parameter */ block->error += 4 * 2 * me->params->xbsep_luma * 10; - mvdc->metric = block->error/16; + mv->metric = block->error/16; schro_block_fixup (block); block->entropy = 0; @@ -639,15 +639,15 @@ schro_motionest_block_scan_one (SchroMotionEst *me, int ref, int distance, mv = &block->mv[jj][ii]; hint_mv = motion_field_get (hint_mf, i + (ii&2), j + (jj&2)); - dx = hint_mv->dx[ref]; - dy = hint_mv->dy[ref]; + dx = hint_mv->u.vec.dx[ref]; + dy = hint_mv->u.vec.dy[ref]; scan.x = (i + ii) * params->xbsep_luma; scan.y = (j + jj) * params->ybsep_luma; schro_metric_scan_setup (&scan, dx, dy, distance); if (scan.scan_width <= 0 || scan.scan_height <= 0) { - mv->dx[ref] = 0; - mv->dy[ref] = 0; + mv->u.vec.dx[ref] = 0; + mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; block->error += mv->metric; block->valid = FALSE; @@ -662,8 +662,8 @@ schro_motionest_block_scan_one (SchroMotionEst *me, int ref, int distance, mv->split = 2; mv->pred_mode = 1<<ref; mv->using_global = 0; - mv->dx[ref] = dx; - mv->dy[ref] = dy; + mv->u.vec.dx[ref] = dx; + mv->u.vec.dy[ref] = dy; } } @@ -709,15 +709,15 @@ schro_motionest_block_scan (SchroMotionEst *me, int ref, int distance, mv = &block->mv[jj][ii]; hint_mv = motion_field_get (hint_mf, i + (ii&2), j + (jj&2)); - dx = hint_mv->dx[ref]; - dy = hint_mv->dy[ref]; + dx = hint_mv->u.vec.dx[ref]; + dy = hint_mv->u.vec.dy[ref]; scan.x = (i + ii) * params->xbsep_luma; scan.y = (j + jj) * params->ybsep_luma; schro_metric_scan_setup (&scan, dx, dy, distance); if (scan.scan_width <= 0 || scan.scan_height <= 0) { - mv->dx[ref] = 0; - mv->dy[ref] = 0; + mv->u.vec.dx[ref] = 0; + mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; block->error += mv->metric; block->valid = FALSE; @@ -732,8 +732,8 @@ schro_motionest_block_scan (SchroMotionEst *me, int ref, int distance, mv->split = 2; mv->pred_mode = 1<<ref; mv->using_global = 0; - mv->dx[ref] = dx; - mv->dy[ref] = dy; + mv->u.vec.dx[ref] = dx; + mv->u.vec.dy[ref] = dy; schro_block_fixup (block); @@ -748,18 +748,18 @@ schro_motionest_block_dc (SchroMotionEst *me, SchroBlock *block, int i, int j, int ii, int jj) { SchroParams *params = me->params; - SchroMotionVectorDC *mvdc; + SchroMotionVector *mv; int chroma_w, chroma_h; SchroFrame *frame; int metric; frame = get_downsampled (me->encoder_frame, 0); - mvdc = (SchroMotionVectorDC *)&(block->mv[jj][ii]); - mvdc->split = 2; - mvdc->pred_mode = 0; + mv = &(block->mv[jj][ii]); + mv->split = 2; + mv->pred_mode = 0; - metric = schro_block_average (&mvdc->dc[0], frame->components + 0, + metric = schro_block_average (&mv->u.dc.dc[0], frame->components + 0, (i + ii) * params->xbsep_luma, (j + jj) * params->ybsep_luma, params->xbsep_luma, params->ybsep_luma); if (metric == SCHRO_METRIC_INVALID_2) { @@ -768,12 +768,12 @@ schro_motionest_block_dc (SchroMotionEst *me, } chroma_w = params->xbsep_luma>>SCHRO_CHROMA_FORMAT_H_SHIFT(params->video_format->chroma_format); chroma_h = params->ybsep_luma>>SCHRO_CHROMA_FORMAT_V_SHIFT(params->video_format->chroma_format); - schro_block_average (&mvdc->dc[1], frame->components + 1, + schro_block_average (&mv->u.dc.dc[1], frame->components + 1, (i + ii) * chroma_w, (j+jj) * chroma_h, chroma_w, chroma_h); - schro_block_average (&mvdc->dc[2], frame->components + 2, + schro_block_average (&mv->u.dc.dc[2], frame->components + 2, (i + ii) * chroma_w, (j+jj) * chroma_h, chroma_w, chroma_h); - mvdc->metric = metric; + mv->metric = metric; block->error = metric; /* FIXME magic parameter */ block->error += 4 * 2 * me->params->xbsep_luma * 10; @@ -796,8 +796,8 @@ schro_motionest_superblock_block (SchroMotionEst *me, for(ii=0;ii<4;ii++){ block.mv[jj][ii].split = 2; block.mv[jj][ii].pred_mode = 1; - block.mv[jj][ii].dx[0] = 0; - block.mv[jj][ii].dy[0] = 0; + block.mv[jj][ii].u.vec.dx[0] = 0; + block.mv[jj][ii].u.vec.dy[0] = 0; } } schro_motion_copy_to (me->motion, i, j, &block); @@ -856,15 +856,15 @@ schro_motionest_subsuperblock_scan (SchroMotionEst *me, int ref, int distance, mv = &block->mv[jj][ii]; hint_mv = motion_field_get (hint_mf, i + (ii&2), j + (jj&2)); - dx = hint_mv->dx[ref]; - dy = hint_mv->dy[ref]; + dx = hint_mv->u.vec.dx[ref]; + dy = hint_mv->u.vec.dy[ref]; scan.x = (i + ii) * params->xbsep_luma; scan.y = (j + jj) * params->ybsep_luma; schro_metric_scan_setup (&scan, dx, dy, distance); if (scan.scan_width <= 0 || scan.scan_height <= 0) { - mv->dx[ref] = 0; - mv->dy[ref] = 0; + mv->u.vec.dx[ref] = 0; + mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; block->error += mv->metric; block->valid = FALSE; @@ -879,8 +879,8 @@ schro_motionest_subsuperblock_scan (SchroMotionEst *me, int ref, int distance, mv->split = 1; mv->pred_mode = 1<<ref; mv->using_global = 0; - mv->dx[ref] = dx; - mv->dy[ref] = dy; + mv->u.vec.dx[ref] = dx; + mv->u.vec.dy[ref] = dy; schro_block_fixup (block); @@ -895,18 +895,18 @@ schro_motionest_subsuperblock_dc (SchroMotionEst *me, SchroBlock *block, int i, int j, int ii, int jj) { SchroParams *params = me->params; - SchroMotionVectorDC *mvdc; + SchroMotionVector *mv; int chroma_w, chroma_h; SchroFrame *frame; int metric; frame = get_downsampled (me->encoder_frame, 0); - mvdc = (SchroMotionVectorDC *)&block->mv[jj][ii]; - mvdc->split = 1; - mvdc->pred_mode = 0; + mv = (SchroMotionVector *)&block->mv[jj][ii]; + mv->split = 1; + mv->pred_mode = 0; - metric = schro_block_average (&mvdc->dc[0], frame->components + 0, + metric = schro_block_average (&mv->u.dc.dc[0], frame->components + 0, (i + ii) * params->xbsep_luma, (j + jj) * params->ybsep_luma, 2*params->xbsep_luma, 2*params->ybsep_luma); if (metric == SCHRO_METRIC_INVALID_2) { @@ -915,12 +915,12 @@ schro_motionest_subsuperblock_dc (SchroMotionEst *me, } chroma_w = params->xbsep_luma>>SCHRO_CHROMA_FORMAT_H_SHIFT(params->video_format->chroma_format); chroma_h = params->ybsep_luma>>SCHRO_CHROMA_FORMAT_V_SHIFT(params->video_format->chroma_format); - schro_block_average (&mvdc->dc[1], frame->components + 1, + schro_block_average (&mv->u.dc.dc[1], frame->components + 1, (i + ii) * chroma_w, (j+jj) * chroma_h, 2*chroma_w, 2*chroma_h); - schro_block_average (&mvdc->dc[2], frame->components + 2, + schro_block_average (&mv->u.dc.dc[2], frame->components + 2, (i + ii) * chroma_w, (j+jj) * chroma_h, 2*chroma_w, 2*chroma_h); - mvdc->metric = metric / 4; + mv->metric = metric / 4; block->error = metric; /* FIXME magic parameter */ block->error += 4 * 2 * me->params->xbsep_luma * 10; @@ -929,7 +929,7 @@ schro_motionest_subsuperblock_dc (SchroMotionEst *me, block->error = schro_motionest_superblock_get_metric (me, block, i, j); /* FIXME magic parameter */ block->error += 4 * 2 * me->params->xbsep_luma * 10; - mvdc->metric = block->error/16; + mv->metric = block->error/16; #endif block->entropy = schro_motion_block_estimate_entropy (me->motion, @@ -950,8 +950,8 @@ schro_motionest_superblock_subsuperblock (SchroMotionEst *me, for(ii=0;ii<4;ii++){ block.mv[jj][ii].split = 1; block.mv[jj][ii].pred_mode = 1; - block.mv[jj][ii].dx[0] = 0; - block.mv[jj][ii].dy[0] = 0; + block.mv[jj][ii].u.vec.dx[0] = 0; + block.mv[jj][ii].u.vec.dy[0] = 0; } } schro_motion_copy_to (me->motion, i, j, &block); @@ -1104,14 +1104,13 @@ schro_motion_block_estimate_entropy (SchroMotion *motion, int i, int j) if (mv->split == 1 && (i&1 || j&1)) return 0; if (mv->pred_mode == 0) { - SchroMotionVectorDC *mvdc = (SchroMotionVectorDC *)mv; int pred[3]; schro_motion_dc_prediction (motion, i, j, pred); - entropy += schro_pack_estimate_sint (mvdc->dc[0] - pred[0]); - entropy += schro_pack_estimate_sint (mvdc->dc[1] - pred[1]); - entropy += schro_pack_estimate_sint (mvdc->dc[2] - pred[2]); + entropy += schro_pack_estimate_sint (mv->u.dc.dc[0] - pred[0]); + entropy += schro_pack_estimate_sint (mv->u.dc.dc[1] - pred[1]); + entropy += schro_pack_estimate_sint (mv->u.dc.dc[2] - pred[2]); return entropy; } @@ -1119,14 +1118,14 @@ schro_motion_block_estimate_entropy (SchroMotion *motion, int i, int j) if (mv->pred_mode & 1) { int pred_x, pred_y; schro_motion_vector_prediction (motion, i, j, &pred_x, &pred_y, 1); - entropy += schro_pack_estimate_sint (mv->dx[0] - pred_x); - entropy += schro_pack_estimate_sint (mv->dy[0] - pred_y); + entropy += schro_pack_estimate_sint (mv->u.vec.dx[0] - pred_x); + entropy += schro_pack_estimate_sint (mv->u.vec.dy[0] - pred_y); } if (mv->pred_mode & 2) { int pred_x, pred_y; schro_motion_vector_prediction (motion, i, j, &pred_x, &pred_y, 2); - entropy += schro_pack_estimate_sint (mv->dx[1] - pred_x); - entropy += schro_pack_estimate_sint (mv->dy[1] - pred_y); + entropy += schro_pack_estimate_sint (mv->u.vec.dx[1] - pred_x); + entropy += schro_pack_estimate_sint (mv->u.vec.dy[1] - pred_y); } return entropy; } @@ -1208,9 +1207,7 @@ schro_motionest_superblock_get_metric (SchroMotionEst *me, mv = &block->mv[0][0]; if (mv->pred_mode == 0) { - SchroMotionVectorDC *mvdc = (SchroMotionVectorDC *)mv; - - return schro_metric_get_dc (&orig, mvdc->dc[0], width, height); + return schro_metric_get_dc (&orig, mv->u.dc.dc[0], width, height); } if (mv->pred_mode == 1 || mv->pred_mode == 2) { SchroFrame *ref_frame; @@ -1221,16 +1218,16 @@ schro_motionest_superblock_get_metric (SchroMotionEst *me, ref_frame = get_downsampled (me->encoder_frame->ref_frame[ref], 0); - if (xmin + mv->dx[ref] < -ref_frame->extension || - ymin + mv->dy[ref] < -ref_frame->extension || - xmax + mv->dx[ref] > me->encoder_frame->filtered_frame->width + ref_frame->extension || - ymax + mv->dy[ref] > me->encoder_frame->filtered_frame->height + ref_frame->extension) { + if (xmin + mv->u.vec.dx[ref] < -ref_frame->extension || + ymin + mv->u.vec.dy[ref] < -ref_frame->extension || + xmax + mv->u.vec.dx[ref] > me->encoder_frame->filtered_frame->width + ref_frame->extension || + ymax + mv->u.vec.dy[ref] > me->encoder_frame->filtered_frame->height + ref_frame->extension) { /* bailing because it's "hard" */ return SCHRO_METRIC_INVALID_2; } schro_frame_get_subdata (ref_frame, &ref_data, - 0, xmin + mv->dx[ref], ymin + mv->dy[ref]); + 0, xmin + mv->u.vec.dx[ref], ymin + mv->u.vec.dy[ref]); return schro_metric_get (&orig, &ref_data, width, height); } @@ -1244,22 +1241,22 @@ schro_motionest_superblock_get_metric (SchroMotionEst *me, ref0_frame = get_downsampled (me->encoder_frame->ref_frame[0], 0); ref1_frame = get_downsampled (me->encoder_frame->ref_frame[1], 0); - if (xmin + mv->dx[0] < -ref0_frame->extension || - ymin + mv->dy[0] < -ref0_frame->extension || - xmax + mv->dx[0] > me->encoder_frame->filtered_frame->width + ref0_frame->extension || - ymax + mv->dy[0] > me->encoder_frame->filtered_frame->height + ref0_frame->extension || - xmin + mv->dx[1] < -ref1_frame->extension || - ymin + mv->dy[1] < -ref1_frame->extension || - xmax + mv->dx[1] > me->encoder_frame->filtered_frame->width + ref1_frame->extension || - ymax + mv->dy[1] > me->encoder_frame->filtered_frame->height + ref1_frame->extension) { + if (xmin + mv->u.vec.dx[0] < -ref0_frame->extension || + ymin + mv->u.vec.dy[0] < -ref0_frame->extension || + xmax + mv->u.vec.dx[0] > me->encoder_frame->filtered_frame->width + ref0_frame->extension || + ymax + mv->u.vec.dy[0] > me->encoder_frame->filtered_frame->height + ref0_frame->extension || + xmin + mv->u.vec.dx[1] < -ref1_frame->extension || + ymin + mv->u.vec.dy[1] < -ref1_frame->extension || + xmax + mv->u.vec.dx[1] > me->encoder_frame->filtered_frame->width + ref1_frame->extension || + ymax + mv->u.vec.dy[1] > me->encoder_frame->filtered_frame->height + ref1_frame->extension) { /* bailing because it's "hard" */ return SCHRO_METRIC_INVALID_2; } schro_frame_get_subdata (ref0_frame, - &ref0_data, 0, xmin + mv->dx[0], ymin + mv->dy[0]); + &ref0_data, 0, xmin + mv->u.vec.dx[0], ymin + mv->u.vec.dy[0]); schro_frame_get_subdata (ref1_frame, - &ref1_data, 0, xmin + mv->dx[1], ymin + mv->dy[1]); + &ref1_data, 0, xmin + mv->u.vec.dx[1], ymin + mv->u.vec.dy[1]); return schro_metric_get_biref (&orig, &ref0_data, 1, &ref1_data, 1, 1, width, height); } diff --git a/schroedinger/schrophasecorrelation.c b/schroedinger/schrophasecorrelation.c index 8413528..eadd190 100644 --- a/schroedinger/schrophasecorrelation.c +++ b/schroedinger/schrophasecorrelation.c @@ -511,8 +511,8 @@ out: mv->split = 0; mv->pred_mode = 1<<ref; mv->using_global = 0; - mv->dx[ref] = dx; - mv->dy[ref] = dy; + mv->u.vec.dx[ref] = dx; + mv->u.vec.dy[ref] = dy; block->error = schro_motionest_superblock_get_metric (me, block, i, j); block->entropy = 0; schro_block_fixup (block); diff --git a/schroedinger/schroroughmotion.c b/schroedinger/schroroughmotion.c index 1046c72..99c6390 100644 --- a/schroedinger/schroroughmotion.c +++ b/schroedinger/schroroughmotion.c @@ -113,8 +113,8 @@ schro_rough_me_heirarchical_scan_nohint (SchroRoughME *rme, int shift, mv = motion_field_get (mf, i, j); if (scan.scan_width <= 0 || scan.scan_height <= 0) { - mv->dx[0] = 0 << shift; - mv->dy[0] = 0 << shift; + mv->u.vec.dx[0] = 0 << shift; + mv->u.vec.dy[0] = 0 << shift; mv->metric = SCHRO_METRIC_INVALID; continue; } @@ -123,8 +123,8 @@ schro_rough_me_heirarchical_scan_nohint (SchroRoughME *rme, int shift, * scan smaller block sizes */ if (scan.x + scan.block_width >= scan.ref_frame->width || scan.y + scan.block_height >= scan.ref_frame->height) { - mv->dx[0] = 0 << shift; - mv->dy[0] = 0 << shift; + mv->u.vec.dx[0] = 0 << shift; + mv->u.vec.dy[0] = 0 << shift; mv->metric = SCHRO_METRIC_INVALID; continue; } @@ -135,8 +135,8 @@ schro_rough_me_heirarchical_scan_nohint (SchroRoughME *rme, int shift, dx <<= shift; dy <<= shift; - mv->dx[ref] = dx; - mv->dy[ref] = dy; + mv->u.vec.dx[ref] = dx; + mv->u.vec.dy[ref] = dy; } } @@ -241,8 +241,8 @@ schro_rough_me_heirarchical_scan_hint (SchroRoughME *rme, int shift, int width, height; int x,y; - dx = hint_mv[m]->dx[ref]; - dy = hint_mv[m]->dy[ref]; + dx = hint_mv[m]->u.vec.dx[ref]; + dy = hint_mv[m]->u.vec.dy[ref]; x = (i*params->xbsep_luma + dx) >> shift; @@ -270,8 +270,8 @@ schro_rough_me_heirarchical_scan_hint (SchroRoughME *rme, int shift, } } - dx = hint_mv[min_m]->dx[ref] >> shift; - dy = hint_mv[min_m]->dy[ref] >> shift; + dx = hint_mv[min_m]->u.vec.dx[ref] >> shift; + dy = hint_mv[min_m]->u.vec.dy[ref] >> shift; scan.x = (i>>shift) * params->xbsep_luma; scan.y = (j>>shift) * params->ybsep_luma; @@ -281,8 +281,8 @@ schro_rough_me_heirarchical_scan_hint (SchroRoughME *rme, int shift, mv = motion_field_get (mf, i, j); if (scan.scan_width <= 0 || scan.scan_height <= 0) { - mv->dx[ref] = 0; - mv->dy[ref] = 0; + mv->u.vec.dx[ref] = 0; + mv->u.vec.dy[ref] = 0; mv->metric = SCHRO_METRIC_INVALID; continue; } @@ -292,8 +292,8 @@ schro_rough_me_heirarchical_scan_hint (SchroRoughME *rme, int shift, dx <<= shift; dy <<= shift; - mv->dx[ref] = dx; - mv->dy[ref] = dy; + mv->u.vec.dx[ref] = dx; + mv->u.vec.dy[ref] = dy; } } diff --git a/testsuite/motion.c b/testsuite/motion.c index 60e5739..1c47f7f 100644 --- a/testsuite/motion.c +++ b/testsuite/motion.c @@ -67,8 +67,8 @@ main (int argc, char *argv[]) printf("sizeof(SchroMotionVector) = %lu\n",(unsigned long) sizeof(SchroMotionVector)); printf("num blocks %d x %d\n", params.x_num_blocks, params.y_num_blocks); for(i=0;i<params.x_num_blocks*params.y_num_blocks;i++){ - motion_vectors[i].dx[0] = 0; - motion_vectors[i].dy[0] = 0; + motion_vectors[i].u.vec.dx[0] = 0; + motion_vectors[i].u.vec.dy[0] = 0; motion_vectors[i].pred_mode = 1; motion_vectors[i].split = 2; } diff --git a/testsuite/motion2.c b/testsuite/motion2.c index c6f4cc7..6dd8a0e 100644 --- a/testsuite/motion2.c +++ b/testsuite/motion2.c @@ -141,8 +141,8 @@ main (int argc, char *argv[]) motion_vectors[jj+i].pred_mode = 0; } #endif - motion_vectors[jj+i].dx[0] = 0; - motion_vectors[jj+i].dy[0] = -8*i; + motion_vectors[jj+i].u.vec.dx[0] = 0; + motion_vectors[jj+i].u.vec.dy[0] = -8*i; motion_vectors[jj+i].pred_mode = 1; motion_vectors[jj+i].split = 2; } diff --git a/testsuite/wavelet_gain_curve.c b/testsuite/wavelet_gain_curve.c index 5f30182..3935bb1 100644 --- a/testsuite/wavelet_gain_curve.c +++ b/testsuite/wavelet_gain_curve.c @@ -120,6 +120,7 @@ print_subband_quants (double *a, int filter, int n_levels) double b[20]; int i; + c[0] = 0; for(i=0;i<n_levels+1;i++){ c[i] = 1/sqrt(a[i]); //printf("%d %g\n", i, c[i]);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor