On Fri, Dec 30, 2011 at 12:23:54AM +0530, Aneesh Dogra wrote:
>
> --- a/libavcodec/mpegvideo_enc.c
> +++ b/libavcodec/mpegvideo_enc.c
> @@ -1114,7 +1114,7 @@ static int estimate_best_b_count(MpegEncContext *s)
> //emms_c();
> //s->next_picture_ptr->quality;
> p_lambda = s->last_lambda_for[AV_PICTURE_TYPE_P];
> - //p_lambda * FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset;
> + //p_lambda *FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset;
This was correct before.
> @@ -1205,43 +1215,52 @@ static int estimate_best_b_count(MpegEncContext *s)
> s->input_picture[0]->f.type = 0;
> - }else{
> - assert( s->input_picture[0]->f.type ==
> FF_BUFFER_TYPE_USER
> - || s->input_picture[0]->f.type ==
> FF_BUFFER_TYPE_INTERNAL);
> -
> - s->avctx->release_buffer(s->avctx,
> (AVFrame*)s->input_picture[0]);
> + } else {
> + assert(s->input_picture[0]->f.type ==
> + FF_BUFFER_TYPE_USER ||
> + s->input_picture[0]->f.type ==
> + FF_BUFFER_TYPE_INTERNAL);
I personally don't think breaking all these lines helps readability,
but oh well...
> + s->avctx->release_buffer(s->avctx,
> + (AVFrame *) s->input_picture[0]);
Indentation is off.
> @@ -1267,121 +1288,142 @@ static int select_input_picture(MpegEncContext *s){
>
> - if(s->picture_in_gop_number + b_frames >= s->gop_size){
> - if((s->flags2 & CODEC_FLAG2_STRICT_GOP) && s->gop_size >
> s->picture_in_gop_number){
> - b_frames= s->gop_size - s->picture_in_gop_number - 1;
> - }else{
> - if(s->flags & CODEC_FLAG_CLOSED_GOP)
> - b_frames=0;
> + if (s->picture_in_gop_number + b_frames >= s->gop_size) {
> + if ((s->flags2 & CODEC_FLAG2_STRICT_GOP) &&
> + s->gop_size > s->picture_in_gop_number) {
> + b_frames = s->gop_size - s->picture_in_gop_number - 1;
> + } else {
> + if (s->flags & CODEC_FLAG_CLOSED_GOP)
> + b_frames = 0;
> s->input_picture[b_frames]->f.pict_type = AV_PICTURE_TYPE_I;
> - }
> + }
> }
Indentation is off in this block, some parts are indented with two
(extra?) spaces ...
> - s->reordered_input_picture[0]= s->input_picture[b_frames];
> - if (s->reordered_input_picture[0]->f.pict_type !=
> AV_PICTURE_TYPE_I)
> + s->reordered_input_picture[0] = s->input_picture[b_frames];
> + if (s->reordered_input_picture[0]->f.pict_type !=
> + AV_PICTURE_TYPE_I)
81 character lines get broken now? Oh well ...
> s->reordered_input_picture[0]->f.pict_type =
> AV_PICTURE_TYPE_P;
> - s->reordered_input_picture[0]->f.coded_picture_number =
> s->coded_picture_number++;
> - for(i=0; i<b_frames; i++){
> + s->reordered_input_picture[0]->f.coded_picture_number =
> + s->coded_picture_number++;
> + for (i = 0; i < b_frames; i++) {
> s->reordered_input_picture[i + 1] = s->input_picture[i];
> - s->reordered_input_picture[i + 1]->f.pict_type =
> AV_PICTURE_TYPE_B;
> - s->reordered_input_picture[i + 1]->f.coded_picture_number =
> s->coded_picture_number++;
> + s->reordered_input_picture[i + 1]->f.pict_type =
> + AV_PICTURE_TYPE_B;
> + s->reordered_input_picture[i + 1]->f.coded_picture_number =
> + s->coded_picture_number++;
Align the '='.
> @@ -1390,33 +1432,34 @@ int MPV_encode_picture(AVCodecContext *avctx,
>
> - for(i=0; i<context_count; i++){
> - int start_y= s->thread_context[i]->start_mb_y;
> - int end_y= s->thread_context[i]-> end_mb_y;
> - int h= s->mb_height;
> - uint8_t *start= buf + (size_t)(((int64_t) buf_size)*start_y/h);
> - uint8_t *end = buf + (size_t)(((int64_t) buf_size)* end_y/h);
> + for (i = 0; i < context_count; i++) {
> + int start_y = s->thread_context[i]->start_mb_y;
> + int end_y = s->thread_context[i]-> end_mb_y;
> + int h = s->mb_height;
> + uint8_t *start = buf + (size_t)(((int64_t) buf_size) * start_y / h);
> + uint8_t *end = buf + (size_t)(((int64_t) buf_size) * end_y / h);
Either align the '/' or drop one of the two spaces before end_y.
> @@ -1510,245 +1565,281 @@ vbv_retry:
I got up to here before the deadline.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel