summaryrefslogtreecommitdiff
path: root/libavutil/pixdesc.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-09-12 22:00:45 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-09-12 22:00:45 +0000
commit4660143a2c009031ae7e812bcb966ea784a8881c (patch)
tree52506134c373cf9ada1dce060b1bc6ebb92e773b /libavutil/pixdesc.c
parent78b19cf029b5641b97d66b2dd1e566d28cfe9ed7 (diff)
downloadffmpeg-4660143a2c009031ae7e812bcb966ea784a8881c.tar.gz
Apply minor simplification in av_read_image_line().
Originally committed as revision 25112 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/pixdesc.c')
-rw-r--r--libavutil/pixdesc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index b3885e510d..54f1d7444f 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -53,12 +53,11 @@ void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesiz
}
} else {
const uint8_t *p = data[plane]+ y*linesize[plane] + x*step + comp.offset_plus1-1;
- int is_8bit = 0;
+ int is_8bit = shift + depth <= 8;
- if (shift + depth <= 8) {
+ if (is_8bit)
p += !!(flags & PIX_FMT_BE);
- is_8bit = 1;
- }
+
while(w--){
int val = is_8bit ? *p :
flags & PIX_FMT_BE ? AV_RB16(p) : AV_RL16(p);