hdr video can be used in the pipeline without conversion to rgba8888
This commit is contained in:
@@ -35,21 +35,25 @@ void InitializeBitDepths() {
|
|||||||
bit_depths[PIX_FMT_RGBA8].internal_format = GL_RGBA8;
|
bit_depths[PIX_FMT_RGBA8].internal_format = GL_RGBA8;
|
||||||
bit_depths[PIX_FMT_RGBA8].pixel_format = GL_RGBA;
|
bit_depths[PIX_FMT_RGBA8].pixel_format = GL_RGBA;
|
||||||
bit_depths[PIX_FMT_RGBA8].pixel_type = GL_UNSIGNED_BYTE;
|
bit_depths[PIX_FMT_RGBA8].pixel_type = GL_UNSIGNED_BYTE;
|
||||||
|
bit_depths[PIX_FMT_RGBA8].bytes_per_pixel = 4;
|
||||||
|
|
||||||
bit_depths[PIX_FMT_RGBA16].name = QCoreApplication::translate("bitdepths", "16-bit Integer");
|
bit_depths[PIX_FMT_RGBA16].name = QCoreApplication::translate("bitdepths", "16-bit Integer");
|
||||||
bit_depths[PIX_FMT_RGBA16].internal_format = GL_RGBA16UI;
|
bit_depths[PIX_FMT_RGBA16].internal_format = GL_RGBA16;
|
||||||
bit_depths[PIX_FMT_RGBA16].pixel_format = GL_RGBA_INTEGER;
|
bit_depths[PIX_FMT_RGBA16].pixel_format = GL_RGBA;
|
||||||
bit_depths[PIX_FMT_RGBA16].pixel_type = GL_UNSIGNED_SHORT;
|
bit_depths[PIX_FMT_RGBA16].pixel_type = GL_UNSIGNED_SHORT;
|
||||||
|
bit_depths[PIX_FMT_RGBA16].bytes_per_pixel = 8;
|
||||||
|
|
||||||
bit_depths[PIX_FMT_RGBA16F].name = QCoreApplication::translate("bitdepths", "Half-Float (16-bit)");
|
bit_depths[PIX_FMT_RGBA16F].name = QCoreApplication::translate("bitdepths", "Half-Float (16-bit)");
|
||||||
bit_depths[PIX_FMT_RGBA16F].internal_format = GL_RGBA16F;
|
bit_depths[PIX_FMT_RGBA16F].internal_format = GL_RGBA16F;
|
||||||
bit_depths[PIX_FMT_RGBA16F].pixel_format = GL_RGBA;
|
bit_depths[PIX_FMT_RGBA16F].pixel_format = GL_RGBA;
|
||||||
bit_depths[PIX_FMT_RGBA16F].pixel_type = GL_HALF_FLOAT;
|
bit_depths[PIX_FMT_RGBA16F].pixel_type = GL_HALF_FLOAT;
|
||||||
|
bit_depths[PIX_FMT_RGBA16F].bytes_per_pixel = 8;
|
||||||
|
|
||||||
bit_depths[PIX_FMT_RGBA32F].name = QCoreApplication::translate("bitdepths", "Full-Float (32-bit)");
|
bit_depths[PIX_FMT_RGBA32F].name = QCoreApplication::translate("bitdepths", "Full-Float (32-bit)");
|
||||||
bit_depths[PIX_FMT_RGBA32F].internal_format = GL_RGBA32F;
|
bit_depths[PIX_FMT_RGBA32F].internal_format = GL_RGBA32F;
|
||||||
bit_depths[PIX_FMT_RGBA32F].pixel_format = GL_RGBA;
|
bit_depths[PIX_FMT_RGBA32F].pixel_format = GL_RGBA;
|
||||||
bit_depths[PIX_FMT_RGBA32F].pixel_type = GL_FLOAT;
|
bit_depths[PIX_FMT_RGBA32F].pixel_type = GL_FLOAT;
|
||||||
|
bit_depths[PIX_FMT_RGBA32F].bytes_per_pixel = 16;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ struct BitDepthInfo {
|
|||||||
GLint internal_format;
|
GLint internal_format;
|
||||||
GLenum pixel_format;
|
GLenum pixel_format;
|
||||||
GLenum pixel_type;
|
GLenum pixel_type;
|
||||||
|
int bytes_per_pixel;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -69,8 +69,6 @@ void FramebufferObject::Create(QOpenGLContext *ctx, int width, int height)
|
|||||||
olive::CurrentConfig.export_bit_depth :
|
olive::CurrentConfig.export_bit_depth :
|
||||||
olive::CurrentConfig.playback_bit_depth);
|
olive::CurrentConfig.playback_bit_depth);
|
||||||
|
|
||||||
qDebug() << "hello" << bit_depth.name;
|
|
||||||
|
|
||||||
ctx->functions()->glTexImage2D(
|
ctx->functions()->glTexImage2D(
|
||||||
GL_TEXTURE_2D,
|
GL_TEXTURE_2D,
|
||||||
0,
|
0,
|
||||||
|
|||||||
+2
-4
@@ -37,8 +37,6 @@
|
|||||||
#include "global/debug.h"
|
#include "global/debug.h"
|
||||||
#include "global/timing.h"
|
#include "global/timing.h"
|
||||||
|
|
||||||
const int kRGBAComponentCount = 4;
|
|
||||||
|
|
||||||
Clip::Clip(Sequence* s) :
|
Clip::Clip(Sequence* s) :
|
||||||
sequence(s),
|
sequence(s),
|
||||||
cacher(this),
|
cacher(this),
|
||||||
@@ -584,13 +582,13 @@ bool Clip::Retrieve()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f->glPixelStorei(GL_UNPACK_ROW_LENGTH, frame->linesize[0]/kRGBAComponentCount);
|
|
||||||
|
|
||||||
int video_width = cacher.media_width();
|
int video_width = cacher.media_width();
|
||||||
int video_height = cacher.media_height();
|
int video_height = cacher.media_height();
|
||||||
|
|
||||||
const olive::rendering::BitDepthInfo& bit_depth_info = olive::rendering::bit_depths.at(cacher.media_pixel_format());
|
const olive::rendering::BitDepthInfo& bit_depth_info = olive::rendering::bit_depths.at(cacher.media_pixel_format());
|
||||||
|
|
||||||
|
f->glPixelStorei(GL_UNPACK_ROW_LENGTH, frame->linesize[0]/bit_depth_info.bytes_per_pixel);
|
||||||
|
|
||||||
if (allocate_data) {
|
if (allocate_data) {
|
||||||
|
|
||||||
// the raw frame size may differ from the one we're using (e.g. a lower resolution proxy), so we make sure
|
// the raw frame size may differ from the one we're using (e.g. a lower resolution proxy), so we make sure
|
||||||
|
|||||||
Reference in New Issue
Block a user