mirror of
				https://github.com/nyanmisaka/ffmpeg-rockchip.git
				synced 2025-10-31 12:36:41 +08:00 
			
		
		
		
	avcodec/magicyuv: invert symbols when building vlc
Instead at every decoded symbol.
This commit is contained in:
		| @@ -113,7 +113,7 @@ static int huff_build10(VLC *vlc, uint8_t *len) | |||||||
|     for (i = 1023; i >= 0; i--) { |     for (i = 1023; i >= 0; i--) { | ||||||
|         codes[i] = code >> (32 - he[i].len); |         codes[i] = code >> (32 - he[i].len); | ||||||
|         bits[i]  = he[i].len; |         bits[i]  = he[i].len; | ||||||
|         syms[i]  = he[i].sym; |         syms[i]  = 1023 - he[i].sym; | ||||||
|         code += 0x80000000u >> (he[i].len - 1); |         code += 0x80000000u >> (he[i].len - 1); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -145,7 +145,7 @@ static int huff_build12(VLC *vlc, uint8_t *len) | |||||||
|     for (i = 4095; i >= 0; i--) { |     for (i = 4095; i >= 0; i--) { | ||||||
|         codes[i] = code >> (32 - he[i].len); |         codes[i] = code >> (32 - he[i].len); | ||||||
|         bits[i]  = he[i].len; |         bits[i]  = he[i].len; | ||||||
|         syms[i]  = he[i].sym; |         syms[i]  = 4095 - he[i].sym; | ||||||
|         code += 0x80000000u >> (he[i].len - 1); |         code += 0x80000000u >> (he[i].len - 1); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -177,7 +177,7 @@ static int huff_build(VLC *vlc, uint8_t *len) | |||||||
|     for (i = 255; i >= 0; i--) { |     for (i = 255; i >= 0; i--) { | ||||||
|         codes[i] = code >> (32 - he[i].len); |         codes[i] = code >> (32 - he[i].len); | ||||||
|         bits[i]  = he[i].len; |         bits[i]  = he[i].len; | ||||||
|         syms[i]  = he[i].sym; |         syms[i]  = 255 - he[i].sym; | ||||||
|         code += 0x80000000u >> (he[i].len - 1); |         code += 0x80000000u >> (he[i].len - 1); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -259,7 +259,7 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata, | |||||||
|                     if (pix < 0) |                     if (pix < 0) | ||||||
|                         return AVERROR_INVALIDDATA; |                         return AVERROR_INVALIDDATA; | ||||||
|  |  | ||||||
|                     dst[x] = max - pix; |                     dst[x] = pix; | ||||||
|                 } |                 } | ||||||
|                 dst += stride; |                 dst += stride; | ||||||
|             } |             } | ||||||
| @@ -389,7 +389,7 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, | |||||||
|                     if (pix < 0) |                     if (pix < 0) | ||||||
|                         return AVERROR_INVALIDDATA; |                         return AVERROR_INVALIDDATA; | ||||||
|  |  | ||||||
|                     dst[x] = 255 - pix; |                     dst[x] = pix; | ||||||
|                 } |                 } | ||||||
|                 dst += stride; |                 dst += stride; | ||||||
|             } |             } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Paul B Mahol
					Paul B Mahol