Commit cdb3f2f5 authored by Michael Niedermayer's avatar Michael Niedermayer

mpeg12enc: switch to av_assert

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c88a8327
...@@ -323,7 +323,7 @@ static inline void encode_mb_skip_run(MpegEncContext *s, int run){ ...@@ -323,7 +323,7 @@ static inline void encode_mb_skip_run(MpegEncContext *s, int run){
static av_always_inline void put_qscale(MpegEncContext *s) static av_always_inline void put_qscale(MpegEncContext *s)
{ {
if(s->q_scale_type){ if(s->q_scale_type){
assert(s->qscale>=1 && s->qscale <=12); av_assert2(s->qscale>=1 && s->qscale <=12);
put_bits(&s->pb, 5, inv_non_linear_qscale[s->qscale]); put_bits(&s->pb, 5, inv_non_linear_qscale[s->qscale]);
}else{ }else{
put_bits(&s->pb, 5, s->qscale); put_bits(&s->pb, 5, s->qscale);
...@@ -395,7 +395,7 @@ void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number) ...@@ -395,7 +395,7 @@ void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
} }
put_bits(&s->pb, 2, s->intra_dc_precision); put_bits(&s->pb, 2, s->intra_dc_precision);
assert(s->picture_structure == PICT_FRAME); av_assert0(s->picture_structure == PICT_FRAME);
put_bits(&s->pb, 2, s->picture_structure); put_bits(&s->pb, 2, s->picture_structure);
if (s->progressive_sequence) { if (s->progressive_sequence) {
put_bits(&s->pb, 1, 0); /* no repeat */ put_bits(&s->pb, 1, 0); /* no repeat */
...@@ -474,7 +474,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, ...@@ -474,7 +474,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
} }
} else { } else {
if(first_mb){ if(first_mb){
assert(s->mb_skip_run == 0); av_assert0(s->mb_skip_run == 0);
encode_mb_skip_run(s, s->mb_x); encode_mb_skip_run(s, s->mb_x);
}else{ }else{
encode_mb_skip_run(s, s->mb_skip_run); encode_mb_skip_run(s, s->mb_skip_run);
...@@ -537,7 +537,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, ...@@ -537,7 +537,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
s->last_mv[0][1][0]= s->last_mv[0][0][0]= motion_x; s->last_mv[0][1][0]= s->last_mv[0][0][0]= motion_x;
s->last_mv[0][1][1]= s->last_mv[0][0][1]= motion_y; s->last_mv[0][1][1]= s->last_mv[0][0][1]= motion_y;
}else{ }else{
assert(!s->frame_pred_frame_dct && s->mv_type == MV_TYPE_FIELD); av_assert2(!s->frame_pred_frame_dct && s->mv_type == MV_TYPE_FIELD);
if (cbp) { if (cbp) {
if(s->dquant){ if(s->dquant){
...@@ -604,8 +604,8 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, ...@@ -604,8 +604,8 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
s->b_count++; s->b_count++;
} }
}else{ }else{
assert(s->mv_type == MV_TYPE_FIELD); av_assert2(s->mv_type == MV_TYPE_FIELD);
assert(!s->frame_pred_frame_dct); av_assert2(!s->frame_pred_frame_dct);
if (cbp){ // With coded bloc pattern if (cbp){ // With coded bloc pattern
if (s->dquant) { if (s->dquant) {
if(s->mv_dir == MV_DIR_FORWARD) if(s->mv_dir == MV_DIR_FORWARD)
...@@ -700,7 +700,7 @@ static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code) ...@@ -700,7 +700,7 @@ static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code)
sign = 1; sign = 1;
} }
assert(code > 0 && code <= 16); av_assert2(code > 0 && code <= 16);
put_bits(&s->pb, put_bits(&s->pb,
ff_mpeg12_mbMotionVectorTable[code][1], ff_mpeg12_mbMotionVectorTable[code][1],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment