[x264-devel] commit: Warn about shadowed variable declarations (Anton Mitrofanov )
Håkan Hjort
hakan.hjort at gmail.com
Wed Jun 9 23:16:42 CEST 2010
On Wed, Jun 9, 2010 at 18:39, <git at videolan.org> wrote:
> x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Tue Jun 8 02:43:37 2010 +0400| [7372a9890ec46a8b8badf643f2afcb6de1c0592b] | committer: Jason Garrett-Glaser
>
> Warn about shadowed variable declarations
> Also get rid of a few instances of variable shadowing.
>
-snip-
>
> Diff: http://git.videolan.org/gitweb.cgi/x264.git/?a=commitdiff;h=7372a9890ec46a8b8badf643f2afcb6de1c0592b
Where these bits in ratecontrol.c discussed / checked for code changes?
(Since other commits seems to be doing the reverse... caching values
to not re-read in loops)
Regards,
Håkan
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -241,8 +241,6 @@ void x264_adaptive_quant_frame( x264_t *h,
x264_frame_t *frame, float *quant_off
* FIXME: while they're written in 5 significant digits, they're
only tuned to 2. */
float strength;
float avg_adj = 0.f;
- int width = h->mb.i_mb_width;
- int height = h->mb.i_mb_height;
/* Initialize frame stats */
for( int i = 0; i < 3; i++ )
{
@@ -276,8 +274,8 @@ void x264_adaptive_quant_frame( x264_t *h,
x264_frame_t *frame, float *quant_off
/* Need variance data for weighted prediction */
if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_FAKE ||
h->param.analyse.i_weighted_pred == X264_WEIGHTP_SMART )
{
- for( int mb_y = 0; mb_y < height; mb_y++ )
- for( int mb_x = 0; mb_x < width; mb_x++ )
+ for( int mb_y = 0; mb_y < h->mb.i_mb_height; mb_y++ )
+ for( int mb_x = 0; mb_x < h->mb.i_mb_width; mb_x++ )
x264_ac_energy_mb( h, mb_x, mb_y, frame );
}
else
... more chunk line the one above...
More information about the x264-devel
mailing list