aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorTomas Härdin <git@haerdin.se>2022-05-20 14:44:54 +0200
committerTomas Härdin <git@haerdin.se>2022-06-10 10:50:12 +0200
commitd6d7b78c4609c54966ba06a4dcb93086b9001c22 (patch)
treeb0a86156325e35102c52dacba8b5744dc3892eb9 /libavcodec
parent01827beb70050f117a5cf6a800614b6402db7599 (diff)
downloadffmpeg-d6d7b78c4609c54966ba06a4dcb93086b9001c22.tar.gz
libavcodec/jpeg2000_parser: Rearrange ifs
A modest 8% improvement
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/jpeg2000_parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000_parser.c b/libavcodec/jpeg2000_parser.c
index 4cb7db4225..b2ad9f2579 100644
--- a/libavcodec/jpeg2000_parser.c
+++ b/libavcodec/jpeg2000_parser.c
@@ -160,9 +160,10 @@ static int find_frame_end(JPEG2000ParserContext *m, const uint8_t *buf, int buf_
return i + 1; // End of frame detected, return frame size.
}
m->in_codestream = 0;
- } else if (m->in_codestream && (state64 & 0xFFFF) == 0xFF90) { // Are we in tile part header?
+ } else if (m->in_codestream) {
+ if ((state64 & 0xFFFF) == 0xFF90) { // Are we in tile part header?
m->read_tp = 8;
- } else if (pc->frame_start_found && info_marker((state64 & 0xFFFF0000)>>16) && m->in_codestream && (state64 & 0xFFFF)) {
+ } else if (info_marker((state64 & 0xFFFF0000)>>16) && pc->frame_start_found && (state64 & 0xFFFF)) {
// Calculate number of bytes to skip to get to end of the next marker.
m->skip_bytes = (state64 & 0xFFFF)-1;
@@ -174,6 +175,7 @@ static int find_frame_end(JPEG2000ParserContext *m, const uint8_t *buf, int buf_
m->skip_bytes += 2;
}
}
+ }
}
}