# HG changeset patch # User stefano # Date 1280479332 0 # Node ID 4cecefd36670866052c5e3ac3a8e97b3e83b31de # Parent f214f755f5de5193a799840d61401921945f9ada Rename av_fill_image_linesizes() internal variables max_plane_step and max_plane_step_comp by removing the "plane_" word, and add a comment for explaining what they represent. Increase readability. diff -r f214f755f5de -r 4cecefd36670 imgutils.c --- a/imgutils.c Thu Jul 29 23:44:57 2010 +0000 +++ b/imgutils.c Fri Jul 30 08:42:12 2010 +0000 @@ -28,8 +28,8 @@ { int i; const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; - int max_plane_step [4]; - int max_plane_step_comp[4]; + int max_step [4]; /* max pixel step for each plane */ + int max_step_comp[4]; /* the component for each plane which has the max pixel step */ memset(linesize, 0, 4*sizeof(linesize[0])); @@ -41,19 +41,19 @@ return 0; } - memset(max_plane_step , 0, sizeof(max_plane_step )); - memset(max_plane_step_comp, 0, sizeof(max_plane_step_comp)); + memset(max_step , 0, sizeof(max_step )); + memset(max_step_comp, 0, sizeof(max_step_comp)); for (i = 0; i < 4; i++) { const AVComponentDescriptor *comp = &(desc->comp[i]); - if ((comp->step_minus1+1) > max_plane_step[comp->plane]) { - max_plane_step [comp->plane] = comp->step_minus1+1; - max_plane_step_comp[comp->plane] = i; + if ((comp->step_minus1+1) > max_step[comp->plane]) { + max_step [comp->plane] = comp->step_minus1+1; + max_step_comp[comp->plane] = i; } } for (i = 0; i < 4; i++) { - int s = (max_plane_step_comp[i] == 1 || max_plane_step_comp[i] == 2) ? desc->log2_chroma_w : 0; - linesize[i] = max_plane_step[i] * (((width + (1 << s) - 1)) >> s); + int s = (max_step_comp[i] == 1 || max_step_comp[i] == 2) ? desc->log2_chroma_w : 0; + linesize[i] = max_step[i] * (((width + (1 << s) - 1)) >> s); } return 0;