1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '513d849bb605d3d862da1ada709bd2ca1ac68f58'

* commit '513d849bb605d3d862da1ada709bd2ca1ac68f58':
  mpeg4videodec: move num_sprite_warping_points from MpegEncContext to Mpeg4DecContext

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-11-30 04:34:43 +01:00
commit 7f18cb9101
4 changed files with 12 additions and 11 deletions

View File

@ -67,6 +67,8 @@ typedef struct Mpeg4DecContext {
int shape;
int vol_sprite_usage;
int sprite_brightness_change;
int num_sprite_warping_points;
// reversible vlc
int rvlc;
///< could this stream contain resync markers

View File

@ -181,7 +181,7 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
if (w <= 0 || h <= 0)
return AVERROR_INVALIDDATA;
for (i = 0; i < s->num_sprite_warping_points; i++) {
for (i = 0; i < ctx->num_sprite_warping_points; i++) {
int length;
int x = 0, y = 0;
@ -249,7 +249,7 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
ROUNDED_DIV(((h - h2) * (r * sprite_ref[0][1] - 16 * vop_ref[0][1]) +
h2 * (r * sprite_ref[2][1] - 16 * vop_ref[2][1])), h);
switch (s->num_sprite_warping_points) {
switch (ctx->num_sprite_warping_points) {
case 0:
s->sprite_offset[0][0] =
s->sprite_offset[0][1] =
@ -368,7 +368,7 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
s->sprite_delta[1][i] <<= shift_y;
s->sprite_shift[i] = 16;
}
s->real_sprite_warping_points = s->num_sprite_warping_points;
s->real_sprite_warping_points = ctx->num_sprite_warping_points;
}
return 0;
@ -1815,12 +1815,12 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
skip_bits(gb, 13); // sprite_top
skip_bits1(gb); /* marker */
}
s->num_sprite_warping_points = get_bits(gb, 6);
if (s->num_sprite_warping_points > 3) {
ctx->num_sprite_warping_points = get_bits(gb, 6);
if (ctx->num_sprite_warping_points > 3) {
av_log(s->avctx, AV_LOG_ERROR,
"%d sprite_warping_points\n",
s->num_sprite_warping_points);
s->num_sprite_warping_points = 0;
ctx->num_sprite_warping_points);
ctx->num_sprite_warping_points = 0;
return -1;
}
s->sprite_warping_accuracy = get_bits(gb, 2);
@ -2431,7 +2431,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
gb->size_in_bits,s->progressive_sequence, s->alternate_scan,
s->top_field_first, s->quarter_sample ? "q" : "h",
s->data_partitioning, ctx->resync_marker,
s->num_sprite_warping_points, s->sprite_warping_accuracy,
ctx->num_sprite_warping_points, s->sprite_warping_accuracy,
1 - s->no_rounding, s->vo_type,
s->vol_control_parameters ? " VOLC" : " ", s->intra_dc_threshold,
ctx->cplx_estimation_trash_i, ctx->cplx_estimation_trash_p,

View File

@ -595,7 +595,6 @@ typedef struct MpegEncContext {
uint16_t pb_time; ///< time distance between the last b and p,s,i frame
uint16_t pp_field_time;
uint16_t pb_field_time; ///< like above, just for interlaced
int num_sprite_warping_points;
int real_sprite_warping_points;
uint16_t sprite_traj[4][2]; ///< sprite trajectory points
int sprite_offset[2][2]; ///< sprite offset[isChroma][isMVY]

View File

@ -73,8 +73,8 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
pic_param->vol_fields.bits.data_partitioned = s->data_partitioning;
pic_param->vol_fields.bits.reversible_vlc = ctx->rvlc;
pic_param->vol_fields.bits.resync_marker_disable = !ctx->resync_marker;
pic_param->no_of_sprite_warping_points = s->num_sprite_warping_points;
for (i = 0; i < s->num_sprite_warping_points && i < 3; i++) {
pic_param->no_of_sprite_warping_points = ctx->num_sprite_warping_points;
for (i = 0; i < ctx->num_sprite_warping_points && i < 3; i++) {
pic_param->sprite_trajectory_du[i] = s->sprite_traj[i][0];
pic_param->sprite_trajectory_dv[i] = s->sprite_traj[i][1];
}