On Tue, Apr 16, 2013 at 03:19:31PM +0200, Anton Khirnov wrote:
> --- a/libavcodec/rv10.c
> +++ b/libavcodec/rv10.c
> @@ -304,56 +303,56 @@ static int rv20_decode_picture_header(RVDecContext *rv)
>
> - i= get_bits(&s->gb, 2);
> - switch(i){
> - case 0: s->pict_type= AV_PICTURE_TYPE_I; break;
> - case 1: s->pict_type= AV_PICTURE_TYPE_I; break; //hmm ...
> - case 2: s->pict_type= AV_PICTURE_TYPE_P; break;
> - case 3: s->pict_type= AV_PICTURE_TYPE_B; break;
> + i = get_bits(&s->gb, 2);
> + switch (i) {
> + case 0: s->pict_type = AV_PICTURE_TYPE_I; break;
> + case 1: s->pict_type = AV_PICTURE_TYPE_I; break; //hmm ...
> + case 2: s->pict_type = AV_PICTURE_TYPE_P; break;
> + case 3: s->pict_type = AV_PICTURE_TYPE_B; break;
I'd break these lines.
> - if(new_w != s->width || new_h != s->height){
> + if (new_w != s->width || new_h != s->height) {
> av_log(s->avctx, AV_LOG_DEBUG, "attempting to change resolution
> to %dx%d\n", new_w, new_h);
Feel like shortening long lines while you're at it?
> @@ -373,18 +372,22 @@ static int rv20_decode_picture_header(RVDecContext *rv)
> + if (s->pp_time <= s->pb_time ||
> + s->pp_time <= s->pp_time - s->pb_time || s->pp_time <= 0) {
> av_log(s->avctx, AV_LOG_DEBUG, "messed up order, possible
> from seeking? skipping current b frame\n");
ditto
> @@ -392,23 +395,20 @@ static int rv20_decode_picture_header(RVDecContext *rv)
> - if(s->avctx->debug & FF_DEBUG_PICT_INFO){
> - av_log(s->avctx, AV_LOG_INFO, "num:%5d x:%2d y:%2d type:%d
> qscale:%2d rnd:%d\n",
> - seq, s->mb_x, s->mb_y, s->pict_type, s->qscale,
> s->no_rounding);
> + if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
> + av_log(s->avctx, AV_LOG_INFO, "num:%5d x:%2d y:%2d type:%d
> qscale:%2d rnd:%d\n",
> + seq, s->mb_x, s->mb_y, s->pict_type, s->qscale,
> s->no_rounding);
> }
pointless {}
> @@ -463,8 +463,9 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
> return AVERROR_PATCHWELCOME;
> }
>
> - if(avctx->debug & FF_DEBUG_PICT_INFO){
> - av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", rv->sub_id,
> avctx->extradata_size >= 4 ? ((uint32_t*)avctx->extradata)[0] : -1);
> + if (avctx->debug & FF_DEBUG_PICT_INFO) {
> + av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", rv->sub_id,
> + avctx->extradata_size >= 4 ? ((uint32_t*)avctx->extradata)[0]
> : -1);
> }
same
> @@ -527,12 +528,12 @@ static int rv10_decode_packet(AVCodecContext *avctx,
>
> if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr==NULL) {
spaces around ==
> - if(s->current_picture_ptr){ //FIXME write parser so we always have
> complete frames?
> + if (s->current_picture_ptr) { //FIXME write parser so we always have
> complete frames?
space after //
> @@ -545,47 +546,46 @@ static int rv10_decode_packet(AVCodecContext *avctx,
>
> - start_mb_x= s->mb_x;
> - s->resync_mb_y= s->mb_y;
> - if(s->h263_aic){
> - s->y_dc_scale_table=
> - s->c_dc_scale_table= ff_aic_dc_scale_table;
> - }else{
> - s->y_dc_scale_table=
> - s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
> + start_mb_x = s->mb_x;
> + s->resync_mb_y = s->mb_y;
> + if (s->h263_aic) {
> + s->y_dc_scale_table = s->c_dc_scale_table = ff_aic_dc_scale_table;
> + } else {
> + s->y_dc_scale_table = s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
> }
if (s->h263_aic) {
s->y_dc_scale_table =
s->c_dc_scale_table = ff_aic_dc_scale_table;
} else {
s->y_dc_scale_table =
s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
}
is more readable IMO, whatever ...
Please add the missing spaces, feel free to ignore the rest; LGTM.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel