History

Deduplicate code by moving it outside the if/else

Originally committed as revision 18269 to svn://svn.ffmpeg.org/ffmpeg/trunk

Reimar Döffinger committed 17 years ago

Commit 15488391 parent 268a6181 file · +2 −8Browse files

Unified · Split

libavcodec/interplayvideo.c+2−8
@@ -421,13 +421,13 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s) · 420 unmodified lines
421 421
422 }422 }
423 } else {423 } else {
424 if (P[2] <= P[3]) {
425 uint64_t flags;424 uint64_t flags;
426 425
427 /* 1 of 4 colors for each 2x1 block, need 8 more bytes */426 /* 1 of 4 colors for each 2x1 or 1x2 block, need 8 more bytes */
428 CHECK_STREAM_PTR(8);427 CHECK_STREAM_PTR(8);
429 428
430 flags = bytestream_get_le64(&s->stream_ptr);429 flags = bytestream_get_le64(&s->stream_ptr);
430 if (P[2] <= P[3]) {
431 for (y = 0; y < 8; y++) {431 for (y = 0; y < 8; y++) {
432 for (x = 0; x < 8; x += 2, flags >>= 2) {432 for (x = 0; x < 8; x += 2, flags >>= 2) {
433 s->pixel_ptr[x ] =433 s->pixel_ptr[x ] =
@@ -436,12 +436,6 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s) · 2 unmodified lines
436 s->pixel_ptr += s->stride;436 s->pixel_ptr += s->stride;
437 }437 }
438 } else {438 } else {
439 uint64_t flags;
440
441 /* 1 of 4 colors for each 1x2 block, need 8 more bytes */
442 CHECK_STREAM_PTR(8);
443
444 flags = bytestream_get_le64(&s->stream_ptr);
445 for (y = 0; y < 8; y += 2) {439 for (y = 0; y < 8; y += 2) {
446 for (x = 0; x < 8; x++, flags >>= 2) {440 for (x = 0; x < 8; x++, flags >>= 2) {
447 s->pixel_ptr[x ] =441 s->pixel_ptr[x ] =

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t