comparison vp8.c @ 12201:c4b53914f286 libavcodec

vp8: add do { } while(0) around XCHG() macro to avoid confusing if/else This is the correct solution to the warning "fixed" in the previous commit.
author mru
date Tue, 20 Jul 2010 17:54:25 +0000
parents b768afb88d1a
children 3465e53116e5
comparison
equal deleted inserted replaced
12200:b768afb88d1a 12201:c4b53914f286
880 uint8_t *top_border_m1 = top_border-32; // for TL prediction 880 uint8_t *top_border_m1 = top_border-32; // for TL prediction
881 src_y -= linesize; 881 src_y -= linesize;
882 src_cb -= uvlinesize; 882 src_cb -= uvlinesize;
883 src_cr -= uvlinesize; 883 src_cr -= uvlinesize;
884 884
885 #define XCHG(a,b,xchg)\ 885 #define XCHG(a,b,xchg) do {\
886 if (xchg) AV_SWAP64(b,a);\ 886 if (xchg) AV_SWAP64(b,a);\
887 else AV_COPY64(b,a); 887 else AV_COPY64(b,a);\
888 } while (0)
888 889
889 XCHG(top_border_m1+8, src_y-8, xchg); 890 XCHG(top_border_m1+8, src_y-8, xchg);
890 XCHG(top_border, src_y, xchg); 891 XCHG(top_border, src_y, xchg);
891 XCHG(top_border+8, src_y+8, 1); 892 XCHG(top_border+8, src_y+8, 1);
892 if (mb_x < mb_width-1) { 893 if (mb_x < mb_width-1)
893 XCHG(top_border+32, src_y+16, 1); 894 XCHG(top_border+32, src_y+16, 1);
894 } 895
895 // only copy chroma for normal loop filter 896 // only copy chroma for normal loop filter
896 // or to initialize the top row to 127 897 // or to initialize the top row to 127
897 if (!simple || !mb_y) { 898 if (!simple || !mb_y) {
898 XCHG(top_border_m1+16, src_cb-8, xchg); 899 XCHG(top_border_m1+16, src_cb-8, xchg);
899 XCHG(top_border_m1+24, src_cr-8, xchg); 900 XCHG(top_border_m1+24, src_cr-8, xchg);