Unified · Split
| @@ -156,7 +156,7 @@ static int query_formats(AVFilterContext *ctx) · 155 unmodified lines | |||
| 156 | static av_always_inline uint32_t dither_color(uint32_t px, int er, int eg, | 156 | static av_always_inline uint32_t dither_color(uint32_t px, int er, int eg, |
| 157 | int eb, int scale, int shift) | 157 | int eb, int scale, int shift) |
| 158 | { | 158 | { |
| 159 | return px >> 24 << 24 | 159 | return (px & 0xff000000) |
| 160 | | av_clip_uint8((px >> 16 & 0xff) + ((er * scale) / (1<<shift))) << 16 | 160 | | av_clip_uint8((px >> 16 & 0xff) + ((er * scale) / (1<<shift))) << 16 |
| 161 | | av_clip_uint8((px >> 8 & 0xff) + ((eg * scale) / (1<<shift))) << 8 | 161 | | av_clip_uint8((px >> 8 & 0xff) + ((eg * scale) / (1<<shift))) << 8 |
| 162 | | av_clip_uint8((px & 0xff) + ((eb * scale) / (1<<shift))); | 162 | | av_clip_uint8((px & 0xff) + ((eb * scale) / (1<<shift))); |
| @@ -187,7 +187,7 @@ static av_always_inline uint8_t colormap_nearest_bruteforce(const uint32_t *pale · 24 unmodified lines | |||
| 187 | 187 | ||
| 188 | if (c >> 24 >= trans_thresh) { // ignore transparent entry | 188 | if (c >> 24 >= trans_thresh) { // ignore transparent entry |
| 189 | const uint8_t palargb[] = { | 189 | const uint8_t palargb[] = { |
| 190 | palette[i]>>24 & 0xff, | 190 | palette[i]>>24, |
| 191 | palette[i]>>16 & 0xff, | 191 | palette[i]>>16 & 0xff, |
| 192 | palette[i]>> 8 & 0xff, | 192 | palette[i]>> 8 & 0xff, |
| 193 | palette[i] & 0xff, | 193 | palette[i] & 0xff, |
| @@ -372,7 +372,7 @@ static av_always_inline int get_dst_color_err(PaletteUseContext *s, · 178 unmodified lines | |||
| 372 | uint32_t c, int *er, int *eg, int *eb, | 372 | uint32_t c, int *er, int *eg, int *eb, |
| 373 | const enum color_search_method search_method) | 373 | const enum color_search_method search_method) |
| 374 | { | 374 | { |
| 375 | const uint8_t a = c >> 24 & 0xff; | 375 | const uint8_t a = c >> 24; |
| 376 | const uint8_t r = c >> 16 & 0xff; | 376 | const uint8_t r = c >> 16 & 0xff; |
| 377 | const uint8_t g = c >> 8 & 0xff; | 377 | const uint8_t g = c >> 8 & 0xff; |
| 378 | const uint8_t b = c & 0xff; | 378 | const uint8_t b = c & 0xff; |
| @@ -411,7 +411,7 @@ static av_always_inline int set_frame(PaletteUseContext *s, AVFrame *out, AVFram · 32 unmodified lines | |||
| 411 | 411 | ||
| 412 | if (dither == DITHERING_BAYER) { | 412 | if (dither == DITHERING_BAYER) { |
| 413 | const int d = s->ordered_dither[(y & 7)<<3 | (x & 7)]; | 413 | const int d = s->ordered_dither[(y & 7)<<3 | (x & 7)]; |
| 414 | const uint8_t a8 = src[x] >> 24 & 0xff; | 414 | const uint8_t a8 = src[x] >> 24; |
| 415 | const uint8_t r8 = src[x] >> 16 & 0xff; | 415 | const uint8_t r8 = src[x] >> 16 & 0xff; |
| 416 | const uint8_t g8 = src[x] >> 8 & 0xff; | 416 | const uint8_t g8 = src[x] >> 8 & 0xff; |
| 417 | const uint8_t b8 = src[x] & 0xff; | 417 | const uint8_t b8 = src[x] & 0xff; |
| @@ -483,7 +483,7 @@ static av_always_inline int set_frame(PaletteUseContext *s, AVFrame *out, AVFram · 65 unmodified lines | |||
| 483 | if ( down) src[src_linesize + x ] = dither_color(src[src_linesize + x ], er, eg, eb, 1, 2); | 483 | if ( down) src[src_linesize + x ] = dither_color(src[src_linesize + x ], er, eg, eb, 1, 2); |
| 484 | 484 | ||
| 485 | } else { | 485 | } else { |
| 486 | const uint8_t a = src[x] >> 24 & 0xff; | 486 | const uint8_t a = src[x] >> 24; |
| 487 | const uint8_t r = src[x] >> 16 & 0xff; | 487 | const uint8_t r = src[x] >> 16 & 0xff; |
| 488 | const uint8_t g = src[x] >> 8 & 0xff; | 488 | const uint8_t g = src[x] >> 8 & 0xff; |
| 489 | const uint8_t b = src[x] & 0xff; | 489 | const uint8_t b = src[x] & 0xff; |
| @@ -630,7 +630,7 @@ static int get_next_color(const uint8_t *color_used, const uint32_t *palette, · 140 unmodified lines | |||
| 630 | 630 | ||
| 631 | for (i = 0; i < AVPALETTE_COUNT; i++) { | 631 | for (i = 0; i < AVPALETTE_COUNT; i++) { |
| 632 | const uint32_t c = palette[i]; | 632 | const uint32_t c = palette[i]; |
| 633 | const uint8_t a = c >> 24 & 0xff; | 633 | const uint8_t a = c >> 24; |
| 634 | const uint8_t r = c >> 16 & 0xff; | 634 | const uint8_t r = c >> 16 & 0xff; |
| 635 | const uint8_t g = c >> 8 & 0xff; | 635 | const uint8_t g = c >> 8 & 0xff; |
| 636 | const uint8_t b = c & 0xff; | 636 | const uint8_t b = c & 0xff; |
| @@ -700,7 +700,7 @@ static int colormap_insert(struct color_node *map, · 63 unmodified lines | |||
| 700 | node = &map[cur_id]; | 700 | node = &map[cur_id]; |
| 701 | node->split = component; | 701 | node->split = component; |
| 702 | node->palette_id = pal_id; | 702 | node->palette_id = pal_id; |
| 703 | node->val[0] = c>>24 & 0xff; | 703 | node->val[0] = c>>24; |
| 704 | node->val[1] = c>>16 & 0xff; | 704 | node->val[1] = c>>16 & 0xff; |
| 705 | node->val[2] = c>> 8 & 0xff; | 705 | node->val[2] = c>> 8 & 0xff; |
| 706 | node->val[3] = c & 0xff; | 706 | node->val[3] = c & 0xff; |