Mercurial > libavcore.hg
comparison imgutils.c @ 25:63d8168fa16a libavcore
Cosmetics: use plural form for *linesizes arguments of
av_image_copy(), more consistent with the rest of the API and more
semantically correct.
author | stefano |
---|---|
date | Tue, 07 Sep 2010 21:24:06 +0000 |
parents | c063c88b1309 |
children | ec642b5a1d0a |
comparison
equal
deleted
inserted
replaced
24:c063c88b1309 | 25:63d8168fa16a |
---|---|
150 dst += dst_linesize; | 150 dst += dst_linesize; |
151 src += src_linesize; | 151 src += src_linesize; |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
155 void av_image_copy(uint8_t *dst_data[4], int dst_linesize[4], | 155 void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], |
156 const uint8_t *src_data[4], const int src_linesize[4], | 156 const uint8_t *src_data[4], const int src_linesizes[4], |
157 enum PixelFormat pix_fmt, int width, int height) | 157 enum PixelFormat pix_fmt, int width, int height) |
158 { | 158 { |
159 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; | 159 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; |
160 | 160 |
161 if (desc->flags & PIX_FMT_HWACCEL) | 161 if (desc->flags & PIX_FMT_HWACCEL) |
162 return; | 162 return; |
163 | 163 |
164 if (desc->flags & PIX_FMT_PAL) { | 164 if (desc->flags & PIX_FMT_PAL) { |
165 av_image_copy_plane(dst_data[0], dst_linesize[0], | 165 av_image_copy_plane(dst_data[0], dst_linesizes[0], |
166 src_data[0], src_linesize[0], | 166 src_data[0], src_linesizes[0], |
167 width, height); | 167 width, height); |
168 /* copy the palette */ | 168 /* copy the palette */ |
169 memcpy(dst_data[1], src_data[1], 4*256); | 169 memcpy(dst_data[1], src_data[1], 4*256); |
170 } else { | 170 } else { |
171 int i, planes_nb = 0; | 171 int i, planes_nb = 0; |
177 int h = height; | 177 int h = height; |
178 int bwidth = av_image_get_linesize(pix_fmt, width, i); | 178 int bwidth = av_image_get_linesize(pix_fmt, width, i); |
179 if (i == 1 || i == 2) { | 179 if (i == 1 || i == 2) { |
180 h= -((-height)>>desc->log2_chroma_h); | 180 h= -((-height)>>desc->log2_chroma_h); |
181 } | 181 } |
182 av_image_copy_plane(dst_data[i], dst_linesize[i], | 182 av_image_copy_plane(dst_data[i], dst_linesizes[i], |
183 src_data[i], src_linesize[i], | 183 src_data[i], src_linesizes[i], |
184 bwidth, h); | 184 bwidth, h); |
185 } | 185 } |
186 } | 186 } |
187 } | 187 } |
188 | 188 |