mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-30 12:44:07 +00:00
Changed frame 8bit to 10bit conversion to be done without memory allocation
This commit is contained in:
parent
6453a511d7
commit
58f12bd530
|
@ -907,13 +907,11 @@ int encoder_feed_frame(encoder_state_t *const state, kvz_picture *const img_in)
|
||||||
}
|
}
|
||||||
|
|
||||||
int frame_8bit_to_10bit(pixel_t* input, int width, int height) {
|
int frame_8bit_to_10bit(pixel_t* input, int width, int height) {
|
||||||
uint8_t* temp_buffer = malloc(width*height);
|
uint8_t* temp_buffer = (uint8_t*)input;
|
||||||
const uint32_t pixels = width*height;
|
const uint32_t pixels = width*height;
|
||||||
memcpy(temp_buffer, (void *)input, pixels);
|
for(int i = pixels-1; i >= 0; i--) {
|
||||||
for(int i = 0; i < pixels; i++) {
|
|
||||||
input[i] = temp_buffer[i]<<2;
|
input[i] = temp_buffer[i]<<2;
|
||||||
}
|
}
|
||||||
free(temp_buffer);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue