Mercurial > libavcodec.hg
comparison utils.c @ 12320:035ca6548e29 libavcodec
Use av_fill_image_pointers/linesizes in place of ff_fill_pointer/linesize,
and drop the the ff_ variants at the next major bump.
| author | stefano |
|---|---|
| date | Sat, 31 Jul 2010 16:46:20 +0000 |
| parents | fbc6fc80e6c6 |
| children | 5dffb531b1cc |
comparison
equal
deleted
inserted
replaced
| 12319:014e19fbfae7 | 12320:035ca6548e29 |
|---|---|
| 27 | 27 |
| 28 #include "libavutil/avstring.h" | 28 #include "libavutil/avstring.h" |
| 29 #include "libavutil/integer.h" | 29 #include "libavutil/integer.h" |
| 30 #include "libavutil/crc.h" | 30 #include "libavutil/crc.h" |
| 31 #include "libavutil/pixdesc.h" | 31 #include "libavutil/pixdesc.h" |
| 32 #include "libavcore/imgutils.h" | |
| 32 #include "avcodec.h" | 33 #include "avcodec.h" |
| 33 #include "dsputil.h" | 34 #include "dsputil.h" |
| 34 #include "opt.h" | 35 #include "opt.h" |
| 35 #include "imgconvert.h" | 36 #include "imgconvert.h" |
| 36 #include "audioconvert.h" | 37 #include "audioconvert.h" |
| 282 } | 283 } |
| 283 | 284 |
| 284 do { | 285 do { |
| 285 // NOTE: do not align linesizes individually, this breaks e.g. assumptions | 286 // NOTE: do not align linesizes individually, this breaks e.g. assumptions |
| 286 // that linesize[0] == 2*linesize[1] in the MPEG-encoder for 4:2:2 | 287 // that linesize[0] == 2*linesize[1] in the MPEG-encoder for 4:2:2 |
| 287 ff_fill_linesize(&picture, s->pix_fmt, w); | 288 av_fill_image_linesizes(picture.linesize, s->pix_fmt, w); |
| 288 // increase alignment of w for next try (rhs gives the lowest bit set in w) | 289 // increase alignment of w for next try (rhs gives the lowest bit set in w) |
| 289 w += w & ~(w-1); | 290 w += w & ~(w-1); |
| 290 | 291 |
| 291 unaligned = 0; | 292 unaligned = 0; |
| 292 for (i=0; i<4; i++){ | 293 for (i=0; i<4; i++){ |
| 293 unaligned |= picture.linesize[i] % stride_align[i]; | 294 unaligned |= picture.linesize[i] % stride_align[i]; |
| 294 } | 295 } |
| 295 } while (unaligned); | 296 } while (unaligned); |
| 296 | 297 |
| 297 tmpsize = ff_fill_pointer(&picture, NULL, s->pix_fmt, h); | 298 tmpsize = av_fill_image_pointers(picture.data, s->pix_fmt, h, NULL, picture.linesize); |
| 298 if (tmpsize < 0) | 299 if (tmpsize < 0) |
| 299 return -1; | 300 return -1; |
| 300 | 301 |
| 301 for (i=0; i<3 && picture.data[i+1]; i++) | 302 for (i=0; i<3 && picture.data[i+1]; i++) |
| 302 size[i] = picture.data[i+1] - picture.data[i]; | 303 size[i] = picture.data[i+1] - picture.data[i]; |
