Skip to content

Commit

Permalink
upgrade libyuv
Browse files Browse the repository at this point in the history
  • Loading branch information
mpromonet committed Jan 22, 2023
1 parent 7ec2e6e commit fac59ca
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions include/jpegdecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class JpegDecoder : public Codec {
}

void convertAndWrite(const char* buffer, unsigned int rsize, V4l2Output* videoOutput) {
uint8 *i420_p0 = m_i420buffer;
uint8 *i420_p1 = i420_p0 + m_width * m_height;
uint8 *i420_p2 = i420_p1 + m_width * m_height / 2;
uint8_t *i420_p0 = m_i420buffer;
uint8_t *i420_p1 = i420_p0 + m_width * m_height;
uint8_t *i420_p2 = i420_p1 + m_width * m_height / 2;

jpeg_mem_src(&m_cinfo, (unsigned char*)buffer, rsize);
jpeg_read_header(&m_cinfo, TRUE);
Expand All @@ -58,7 +58,7 @@ class JpegDecoder : public Codec {
libyuv::ConvertFromI420(i420_p0, m_width,
i420_p1, (m_width + 1) / 2,
i420_p2, (m_width + 1) / 2,
(uint8 *)outBuffer, 0,
(uint8_t *)outBuffer, 0,
m_width, m_height,
m_outformat);

Expand Down
2 changes: 1 addition & 1 deletion include/jpegencoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class JpegEncoder : public Codec {
unsigned char * buffer_u = buffer_y + m_width*m_height;
unsigned char * buffer_v = buffer_u + m_width*m_height/4;

libyuv::ConvertToI420((const uint8*)buffer, rsize,
libyuv::ConvertToI420((const uint8_t*)buffer, rsize,
buffer_y, m_width,
buffer_u, (m_width+1)/2,
buffer_v, (m_width+1)/2,
Expand Down
2 changes: 1 addition & 1 deletion include/vpxencoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class VpxEncoder : public Codec {

void convertAndWrite(const char* buffer, unsigned int rsize, V4l2Output* videoOutput) {

libyuv::ConvertToI420((const uint8*)buffer, rsize,
libyuv::ConvertToI420((const uint8_t*)buffer, rsize,
m_input.planes[0], m_width,
m_input.planes[1], (m_width+1)/2,
m_input.planes[2], (m_width+1)/2,
Expand Down
2 changes: 1 addition & 1 deletion include/x264encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class X264Encoder : public Codec {

void convertAndWrite(const char* buffer, unsigned int rsize, V4l2Output* videoOutput) {

libyuv::ConvertToI420((const uint8*)buffer, rsize,
libyuv::ConvertToI420((const uint8_t*)buffer, rsize,
m_pic_in.img.plane[0], m_width,
m_pic_in.img.plane[1], (m_width+1)/2,
m_pic_in.img.plane[2], (m_width+1)/2,
Expand Down
8 changes: 4 additions & 4 deletions include/x265encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ class X265Encoder : public Codec {

void convertAndWrite(const char* buffer, unsigned int rsize, V4l2Output* videoOutput) {

libyuv::ConvertToI420((const uint8*)buffer, rsize,
(uint8*)m_pic_in->planes[0], m_width,
(uint8*)m_pic_in->planes[1], (m_width+1)/2,
(uint8*)m_pic_in->planes[2], (m_width+1)/2,
libyuv::ConvertToI420((const uint8_t*)buffer, rsize,
(uint8_t*)m_pic_in->planes[0], m_width,
(uint8_t*)m_pic_in->planes[1], (m_width+1)/2,
(uint8_t*)m_pic_in->planes[2], (m_width+1)/2,
0, 0,
m_width, m_height,
m_width, m_height,
Expand Down
14 changes: 7 additions & 7 deletions include/yuvconverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class YuvConverter : public Codec
YuvConverter(int outformat, int informat, int width, int height, const std::map<std::string, std::string> &opt, int verbose)
: Codec(informat, width, height), m_outformat(outformat)
{
m_i420 = new uint8[width * height * 2];
m_i420 = new uint8_t[width * height * 2];
}

~YuvConverter()
Expand All @@ -28,11 +28,11 @@ class YuvConverter : public Codec

void convertAndWrite(const char *buffer, unsigned int rsize, V4l2Output *videoOutput)
{
uint8 *i420_p0 = m_i420;
uint8 *i420_p1 = i420_p0 + m_width * m_height;
uint8 *i420_p2 = i420_p1 + m_width * m_height / 2;
uint8_t *i420_p0 = m_i420;
uint8_t *i420_p1 = i420_p0 + m_width * m_height;
uint8_t *i420_p2 = i420_p1 + m_width * m_height / 2;

libyuv::ConvertToI420((const uint8 *)buffer, rsize,
libyuv::ConvertToI420((const uint8_t *)buffer, rsize,
i420_p0, m_width,
i420_p1, (m_width + 1) / 2,
i420_p2, (m_width + 1) / 2,
Expand All @@ -45,7 +45,7 @@ class YuvConverter : public Codec
libyuv::ConvertFromI420(i420_p0, m_width,
i420_p1, (m_width + 1) / 2,
i420_p2, (m_width + 1) / 2,
(uint8 *)outBuffer, 0,
(uint8_t *)outBuffer, 0,
m_width, m_height,
m_outformat);

Expand All @@ -54,7 +54,7 @@ class YuvConverter : public Codec
}

private:
uint8 *m_i420;
uint8_t *m_i420;
int m_outformat;

public:
Expand Down
2 changes: 1 addition & 1 deletion libyuv
Submodule libyuv updated 215 files
2 changes: 1 addition & 1 deletion src/v4l2dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int main(int argc, char* argv[])
||(videoCapture->getFormat() == V4L2_PIX_FMT_MJPEG) ) {
int width = 0;
int height = 0;
if (libyuv::MJPGSize((const uint8*)buffer, rsize, &width, &height) == 0) {
if (libyuv::MJPGSize((const uint8_t*)buffer, rsize, &width, &height) == 0) {
LOG(NOTICE) << "libyuv::MJPGSize " << width << "x" << height;
} else {
LOG(WARN) << "libyuv::MJPGSize error";
Expand Down

0 comments on commit fac59ca

Please sign in to comment.