Hi,

On Wed, Dec 21, 2011 at 11:48 AM, Ronald S. Bultje <[email protected]> wrote:
[review for line 537-1037].
>  static int is_intra_more_likely(MpegEncContext *s){

{ goes on its own line.

> -    if (!s->last_picture_ptr || !s->last_picture_ptr->f.data[0]) return 1; 
> //no previous frame available -> use spatial prediction
> +    if (!s->last_picture_ptr || !s->last_picture_ptr->f.data[0]) return 
> 1;//no previous frame available -> use spatial prediction

Please split line as per:

// comment
if (..)
    return 1;

(what you use later, i.f. "if (..)<newline>    return 1; // comment",
is fine also.)

> +    for (i = 0; i < s->mb_num; i++) {
> +        const int mb_xy = s->mb_index2xy[i];
> +        const int error = s->error_status_table[mb_xy];
> +        if (!((error&ER_DC_ERROR) && (error&ER_MV_ERROR)))
>              undamaged_count++;
>      }

Spaces around &.

> +    if (s->codec_id == CODEC_ID_H264) {
> +        H264Context *h = (void*)s;

(void *) s;

> +void ff_er_add_slice(MpegEncContext *s, int startx, int starty,
> +                     int endx, int endy, int status) {

{ goes on its own line.

> -    if(status & (ER_AC_ERROR|ER_AC_END)){
> +    if (status & (ER_AC_ERROR|ER_AC_END)) {
>          mask &= ~(ER_AC_ERROR|ER_AC_END);

Spaces around |.

> -    if(status & (ER_DC_ERROR|ER_DC_END)){
> +    if (status & (ER_DC_ERROR|ER_DC_END)) {
>          mask &= ~(ER_DC_ERROR|ER_DC_END);

Same.

> -    if(status & (ER_MV_ERROR|ER_MV_END)){
> +    if (status & (ER_MV_ERROR|ER_MV_END)) {
>          mask &= ~(ER_MV_ERROR|ER_MV_END);

Same.

> +    if (start_xy > 0 && s->avctx->thread_count <= 1 &&
> +        s->avctx->skip_top * s->mb_width < start_i)
> +    {
> +        int prev_status = s->error_status_table[ s->mb_index2xy[start_i - 1] 
> ];

No spaces directly after [ or before ], i.e.
"..._table[s->mv_index...[.. - 1]];".

> -        if(prev_status != (ER_MV_END|ER_DC_END|ER_AC_END)) s->error_count= 
> INT_MAX;
> +        if (prev_status != (ER_MV_END|ER_DC_END|ER_AC_END))
> +            s->error_count = INT_MAX;

Spaces around |.

>  void ff_er_frame_end(MpegEncContext *s){

{ gets its own line.

> -    int threshold_part[4]= {100,100,100};
> -    int threshold= 50;
> +    int threshold_part[4] = {100,100,100};

Space after {, after comma and before }, i.e.:

... = { 100, 100, 100 };

> -    if(!s->err_recognition || s->error_count==0 || s->avctx->lowres ||
> +    if (!s->err_recognition || s->error_count == 0 || s->avctx->lowres ||
>         s->avctx->hwaccel ||
>         s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
> -       s->picture_structure != PICT_FRAME || // we do not support ER of 
> field pictures yet, though it should not crash if enabled
> -       s->error_count==3*s->mb_width*(s->avctx->skip_top + 
> s->avctx->skip_bottom)) return;
> +       s->picture_structure != PICT_FRAME ||
> +       // we do not support ER of field pictures yet,
> +       //though it should not crash if enabled
> +       s->error_count==3*s->mb_width*(s->avctx->skip_top + 
> s->avctx->skip_bottom))
> +    {
> +        return;
> +    };

{ goes on previous line with the if, i.e.:

if (.. ||
        ..) {
        return;
}

> +            pic->motion_val_base[i] = av_mallocz((size+4) * 2 * 
> sizeof(uint16_t));

Spaces around +.

> -            if(error&ER_AC_END)
> -                end_ok=0;
> -            if((error&ER_MV_END) || (error&ER_DC_END) || (error&ER_AC_ERROR))
> -                end_ok=1;
> +            if (error&ER_AC_END)
> +                end_ok = 0;
> +            if ((error&ER_MV_END) || (error&ER_DC_END) || 
> (error&ER_AC_ERROR))
> +                end_ok = 1;

Spaces around &.

> -            if(error&VP_START)
> +            if (error&VP_START)
>                  end_ok=0;

Same, and around =.

> +            if (error2 == (VP_START | ER_MB_ERROR | ER_MB_END) &&
> +                error1 != (VP_START | ER_MB_ERROR | ER_MB_END) &&
> +                ((error1 & ER_AC_END) || (error1 & ER_DC_END) || 
> (error1&ER_MV_END)))
> +            { //end & uninit
> +                end_ok = 0;
>              }

{ goes on the if line, and spaces around &.

> -            if(error&VP_START)
> -                distance= 9999999;
> +            if (error&VP_START)
> +                distance = 9999999;

Spaces around &.

> +        if (old_error&VP_START)

Same.

> +        if (error & ER_DC_ERROR) dc_error ++;
> +        if (error & ER_AC_ERROR) ac_error ++;
> +        if (error & ER_MV_ERROR) mv_error ++;

.._error++;, i.e. remove the space between variable and ++.

> -            error= s->error_status_table[mb_xy];
[..]
> +            error= s->error_status_table[mb_xy];

var = val; <- space before =.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to