[FFmpeg-devel] using usb hardware h264 encoders

Diego Biurrun diego
Thu Nov 5 14:19:32 CET 2009


On Wed, Nov 04, 2009 at 04:54:17PM +0200, Sergiy wrote:
> Sorry, it was not full. Here is full patch.

Fix alphabetical order everywhere.  I have mentioned some issues below,
but only the first occurrence, please fix it everywhere.

> --- /dev/null
> +++ b/libavcodec/libcrusher264.c
> @@ -0,0 +1,264 @@
> +
> +/**
> +* @file libavcodec/libcrusher264.c
> +* H.264 encoder support via libcrusher264 library and hardware accelerator; more details about the Crusher
> +* reference platform can be found at http://tipok.org.ua/node/13.

Keep lines below 80 chars where easily possible.

> +    if(!c4->enc.out_blocks)

Use K&R style please, space after if/for/while/switch.

> +    for(i=c4->curr_block; i < c4->enc.out_blocks; i++) {

Space around operators please.

> +                switch (qbox->sample_flags) {
> +                    case CRUSHER_TYPE_SPS_PPS:

Indent the case statements at the same depth as the switch.

> +static int CrusherEnc_frame(AVCodecContext *ctx, uint8_t *buf,
> +                                int bufsize, void *data)

Indentation is off.

> +    if(frame){

space before {

> +        c4->converter.y_stride  = frame->linesize[0];
> +        c4->converter.uv_stride = frame->linesize[1];
> +        c4->converter.y = frame->data[0];
> +        c4->converter.u = frame->data[1];
> +        c4->converter.v = frame->data[2];

The '=' could be aligned.

> +        do  {

one space too much

Diego



More information about the ffmpeg-devel mailing list