mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +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) {
|
||||
uint8_t* temp_buffer = malloc(width*height);
|
||||
uint8_t* temp_buffer = (uint8_t*)input;
|
||||
const uint32_t pixels = width*height;
|
||||
memcpy(temp_buffer, (void *)input, pixels);
|
||||
for(int i = 0; i < pixels; i++) {
|
||||
for(int i = pixels-1; i >= 0; i--) {
|
||||
input[i] = temp_buffer[i]<<2;
|
||||
}
|
||||
free(temp_buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue