summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/theora/video_stream_theora.cpp117
-rw-r--r--drivers/theora/video_stream_theora.h32
-rw-r--r--drivers/webp/dec/alpha.c2
-rw-r--r--drivers/webp/dec/decode_vp8.h2
-rw-r--r--drivers/webp/dec/webp.c2
-rw-r--r--drivers/webp/demux/anim_decode.c6
-rw-r--r--drivers/webp/demux/demux.c8
-rw-r--r--drivers/webp/dsp/dsp.h4
-rw-r--r--drivers/webp/dsp/lossless.h4
-rw-r--r--drivers/webp/enc/alpha.c2
-rw-r--r--drivers/webp/enc/backward_references.h4
-rw-r--r--drivers/webp/enc/config.c2
-rw-r--r--drivers/webp/enc/delta_palettization.c2
-rw-r--r--drivers/webp/enc/delta_palettization.h2
-rw-r--r--drivers/webp/enc/frame.c2
-rw-r--r--drivers/webp/enc/histogram.c2
-rw-r--r--drivers/webp/enc/histogram.h4
-rw-r--r--drivers/webp/enc/syntax.c4
-rw-r--r--drivers/webp/enc/vp8enci.h2
-rw-r--r--drivers/webp/enc/vp8l.c2
-rw-r--r--drivers/webp/enc/vp8li.h4
-rw-r--r--drivers/webp/mux/anim_encode.c8
-rw-r--r--drivers/webp/mux/muxi.h2
-rw-r--r--drivers/webp/utils/bit_reader.c2
-rw-r--r--drivers/webp/utils/bit_reader.h2
-rw-r--r--drivers/webp/utils/bit_reader_inl.h2
-rw-r--r--drivers/webp/utils/bit_writer.h2
-rw-r--r--drivers/webp/utils/color_cache.h2
-rw-r--r--drivers/webp/utils/endian_inl.h4
-rw-r--r--drivers/webp/utils/filters.h2
-rw-r--r--drivers/webp/utils/huffman.c2
-rw-r--r--drivers/webp/utils/huffman.h4
-rw-r--r--drivers/webp/utils/huffman_encode.c2
-rw-r--r--drivers/webp/utils/huffman_encode.h2
-rw-r--r--drivers/webp/utils/quant_levels.h2
-rw-r--r--drivers/webp/utils/quant_levels_dec.h2
-rw-r--r--drivers/webp/utils/random.h2
-rw-r--r--drivers/webp/utils/rescaler.h2
-rw-r--r--drivers/webp/utils/thread.h4
-rw-r--r--drivers/webp/utils/utils.c4
-rw-r--r--drivers/webp/utils/utils.h2
41 files changed, 192 insertions, 71 deletions
diff --git a/drivers/theora/video_stream_theora.cpp b/drivers/theora/video_stream_theora.cpp
index f301bd7515..fe248bc911 100644
--- a/drivers/theora/video_stream_theora.cpp
+++ b/drivers/theora/video_stream_theora.cpp
@@ -7,11 +7,34 @@
int VideoStreamPlaybackTheora:: buffer_data() {
- char *buffer=ogg_sync_buffer(&oy,4096);
- int bytes=file->get_buffer((uint8_t*)buffer, 4096);
- ogg_sync_wrote(&oy,bytes);
- return(bytes);
+ char *buffer=ogg_sync_buffer(&oy,4096);
+
+#ifdef THEORA_USE_THREAD_STREAMING
+
+ int read;
+
+ do {
+ thread_sem->post();
+ read = MIN(ring_buffer.data_left(),4096);
+ if (read) {
+ ring_buffer.read((uint8_t*)buffer,read);
+ ogg_sync_wrote(&oy,read);
+ } else {
+ OS::get_singleton()->delay_usec(100);
+ }
+
+ } while(read==0);
+
+ return read;
+
+#else
+
+ int bytes=file->get_buffer((uint8_t*)buffer, 4096);
+ ogg_sync_wrote(&oy,bytes);
+ return(bytes);
+
+#endif
}
int VideoStreamPlaybackTheora::queue_page(ogg_page *page){
@@ -200,6 +223,14 @@ void VideoStreamPlaybackTheora::clear() {
}
ogg_sync_clear(&oy);
+#ifdef THEORA_USE_THREAD_STREAMING
+ thread_exit=true;
+ thread_sem->post(); //just in case
+ Thread::wait_to_finish(thread);
+ memdelete(thread);
+ thread=NULL;
+ ring_buffer.clear();
+#endif
//file_name = "";
theora_p = 0;
@@ -217,6 +248,7 @@ void VideoStreamPlaybackTheora::clear() {
void VideoStreamPlaybackTheora::set_file(const String& p_file) {
+ ERR_FAIL_COND(playing);
ogg_packet op;
th_setup_info *ts = NULL;
@@ -227,7 +259,17 @@ void VideoStreamPlaybackTheora::set_file(const String& p_file) {
file = FileAccess::open(p_file, FileAccess::READ);
ERR_FAIL_COND(!file);
+#ifdef THEORA_USE_THREAD_STREAMING
+ thread_exit=false;
+ thread_eof=false;
+ //pre-fill buffer
+ int to_read = ring_buffer.space_left();
+ int read = file->get_buffer(read_buffer.ptr(),to_read);
+ ring_buffer.write(read_buffer.ptr(),read);
+ thread=Thread::create(_streaming_thread,this);
+
+#endif
ogg_sync_init(&oy);
@@ -369,6 +411,7 @@ void VideoStreamPlaybackTheora::set_file(const String& p_file) {
th_decode_ctl(td,TH_DECCTL_GET_PPLEVEL_MAX,&pp_level_max,
sizeof(pp_level_max));
pp_level=pp_level_max;
+ pp_level=0;
th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level,sizeof(pp_level));
pp_inc=0;
@@ -415,6 +458,8 @@ void VideoStreamPlaybackTheora::set_file(const String& p_file) {
buffering=true;
time=0;
audio_frames_wrote=0;
+
+
};
float VideoStreamPlaybackTheora::get_time() const {
@@ -436,13 +481,16 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
return;
};
+#ifdef THEORA_USE_THREAD_STREAMING
+ thread_sem->post();
+#endif
+
//double ctime =AudioServer::get_singleton()->get_mix_time();
//print_line("play "+rtos(p_delta));
time+=p_delta;
if (videobuf_time>get_time()) {
-
return; //no new frames need to be produced
}
@@ -573,21 +621,22 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
if(videobuf_time>=get_time()) {
frame_done=true;
- print_line("frame!");
} else{
/*If we are too slow, reduce the pp level.*/
pp_inc=pp_level>0?-1:0;
- print_line("skip!");
}
}
} else {
- print_line("no packet..");
+
break;
}
}
-
+#ifdef THEORA_USE_THREAD_STREAMING
+ if (file && thread_eof && ring_buffer.data_left()==0) {
+#else
if (file && /*!videobuf_ready && */ file->eof_reached()) {
+#endif
printf("video done, stopping\n");
stop();
return;
@@ -633,6 +682,7 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
else if(tdiff<ti.fps_denominator*0.05/ti.fps_numerator){
pp_inc=pp_level>0?-1:0;
}
+
}
video_write();
@@ -644,15 +694,21 @@ void VideoStreamPlaybackTheora::play() {
if (!playing)
time=0;
+ else {
+ stop();
+ }
+
playing = true;
delay_compensation=Globals::get_singleton()->get("audio/video_delay_compensation_ms");
delay_compensation/=1000.0;
+
};
void VideoStreamPlaybackTheora::stop() {
if (playing) {
+
clear();
set_file(file_name); //reset
}
@@ -730,7 +786,33 @@ int VideoStreamPlaybackTheora::get_mix_rate() const{
return vi.rate;
}
+#ifdef THEORA_USE_THREAD_STREAMING
+
+
+void VideoStreamPlaybackTheora::_streaming_thread(void *ud) {
+
+ VideoStreamPlaybackTheora *vs=(VideoStreamPlaybackTheora*)ud;
+
+ while(!vs->thread_exit) {
+
+ //just fill back the buffer
+ if (!vs->thread_eof) {
+
+ int to_read = vs->ring_buffer.space_left();
+ if (to_read) {
+ int read = vs->file->get_buffer(vs->read_buffer.ptr(),to_read);
+ vs->ring_buffer.write(vs->read_buffer.ptr(),read);
+ vs->thread_eof=vs->file->eof_reached();
+ }
+
+
+ }
+
+ vs->thread_sem->wait();
+ }
+}
+#endif
VideoStreamPlaybackTheora::VideoStreamPlaybackTheora() {
@@ -749,14 +831,31 @@ VideoStreamPlaybackTheora::VideoStreamPlaybackTheora() {
audio_track=0;
delay_compensation=0;
audio_frames_wrote=0;
+
+#ifdef THEORA_USE_THREAD_STREAMING
+ int rb_power = nearest_shift(RB_SIZE_KB*1024);
+ ring_buffer.resize(rb_power);
+ read_buffer.resize(RB_SIZE_KB*1024);
+ thread_sem=Semaphore::create();
+ thread=NULL;
+ thread_exit=false;
+ thread_eof=false;
+
+#endif
};
VideoStreamPlaybackTheora::~VideoStreamPlaybackTheora() {
+#ifdef THEORA_USE_THREAD_STREAMING
+
+ memdelete(thread_sem);
+#endif
clear();
if (file)
memdelete(file);
+
+
};
diff --git a/drivers/theora/video_stream_theora.h b/drivers/theora/video_stream_theora.h
index 5540f050f9..c15ef31cfc 100644
--- a/drivers/theora/video_stream_theora.h
+++ b/drivers/theora/video_stream_theora.h
@@ -6,9 +6,13 @@
#include "theora/theoradec.h"
#include "vorbis/codec.h"
#include "os/file_access.h"
-
+#include "ring_buffer.h"
#include "io/resource_loader.h"
#include "scene/resources/video_stream.h"
+#include "os/thread.h"
+#include "os/semaphore.h"
+
+//#define THEORA_USE_THREAD_STREAMING
class VideoStreamPlaybackTheora : public VideoStreamPlayback {
@@ -66,7 +70,25 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback {
AudioMixCallback mix_callback;
void* mix_udata;
- int audio_track;
+#ifdef THEORA_USE_THREAD_STREAMING
+
+ enum {
+ RB_SIZE_KB=1024
+ };
+
+ RingBuffer<uint8_t> ring_buffer;
+ Vector<uint8_t> read_buffer;
+ bool thread_eof;
+ Semaphore *thread_sem;
+ Thread *thread;
+ volatile bool thread_exit;
+
+ static void _streaming_thread(void *ud);
+
+#endif
+
+
+ int audio_track;
protected:
@@ -116,20 +138,20 @@ class VideoStreamTheora : public VideoStream {
OBJ_TYPE(VideoStreamTheora,VideoStream);
String file;
- int audio_track;
+ int audio_track;
public:
Ref<VideoStreamPlayback> instance_playback() {
Ref<VideoStreamPlaybackTheora> pb = memnew( VideoStreamPlaybackTheora );
- pb->set_audio_track(audio_track);
+ pb->set_audio_track(audio_track);
pb->set_file(file);
return pb;
}
void set_file(const String& p_file) { file=p_file; }
- void set_audio_track(int p_track) { audio_track=p_track; }
+ void set_audio_track(int p_track) { audio_track=p_track; }
VideoStreamTheora() { audio_track=0; }
diff --git a/drivers/webp/dec/alpha.c b/drivers/webp/dec/alpha.c
index 52216fc4d6..1d029b0e6a 100644
--- a/drivers/webp/dec/alpha.c
+++ b/drivers/webp/dec/alpha.c
@@ -18,7 +18,7 @@
#include "../dsp/dsp.h"
#include "../utils/quant_levels_dec.h"
#include "../utils/utils.h"
-#include "../webp/format_constants.h"
+#include "webp/format_constants.h"
//------------------------------------------------------------------------------
// ALPHDecoder object.
diff --git a/drivers/webp/dec/decode_vp8.h b/drivers/webp/dec/decode_vp8.h
index b9337bbec0..2bf1bdbbf5 100644
--- a/drivers/webp/dec/decode_vp8.h
+++ b/drivers/webp/dec/decode_vp8.h
@@ -14,7 +14,7 @@
#ifndef WEBP_WEBP_DECODE_VP8_H_
#define WEBP_WEBP_DECODE_VP8_H_
-#include "../webp/decode.h"
+#include "webp/decode.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/dec/webp.c b/drivers/webp/dec/webp.c
index 952178fa89..93a113a48d 100644
--- a/drivers/webp/dec/webp.c
+++ b/drivers/webp/dec/webp.c
@@ -17,7 +17,7 @@
#include "./vp8li.h"
#include "./webpi.h"
#include "../utils/utils.h"
-#include "../webp/mux_types.h" // ALPHA_FLAG
+#include "webp/mux_types.h" // ALPHA_FLAG
//------------------------------------------------------------------------------
// RIFF layout is:
diff --git a/drivers/webp/demux/anim_decode.c b/drivers/webp/demux/anim_decode.c
index adf84cd193..c81cedfba0 100644
--- a/drivers/webp/demux/anim_decode.c
+++ b/drivers/webp/demux/anim_decode.c
@@ -11,15 +11,15 @@
//
#ifdef HAVE_CONFIG_H
-#include "../webp/config.h"
+#include "webp/config.h"
#endif
#include <assert.h>
#include <string.h>
#include "../utils/utils.h"
-#include "../webp/decode.h"
-#include "../webp/demux.h"
+#include "webp/decode.h"
+#include "webp/demux.h"
#define NUM_CHANNELS 4
diff --git a/drivers/webp/demux/demux.c b/drivers/webp/demux/demux.c
index e8e5418efe..3717e21165 100644
--- a/drivers/webp/demux/demux.c
+++ b/drivers/webp/demux/demux.c
@@ -11,7 +11,7 @@
//
#ifdef HAVE_CONFIG_H
-#include "../webp/config.h"
+#include "webp/config.h"
#endif
#include <assert.h>
@@ -19,9 +19,9 @@
#include <string.h>
#include "../utils/utils.h"
-#include "../webp/decode.h" // WebPGetFeatures
-#include "../webp/demux.h"
-#include "../webp/format_constants.h"
+#include "webp/decode.h" // WebPGetFeatures
+#include "webp/demux.h"
+#include "webp/format_constants.h"
#define DMUX_MAJ_VERSION 0
#define DMUX_MIN_VERSION 2
diff --git a/drivers/webp/dsp/dsp.h b/drivers/webp/dsp/dsp.h
index 8395df40e4..4613d9c3ff 100644
--- a/drivers/webp/dsp/dsp.h
+++ b/drivers/webp/dsp/dsp.h
@@ -15,10 +15,10 @@
#define WEBP_DSP_DSP_H_
#ifdef HAVE_CONFIG_H
-#include "../webp/config.h"
+#include "webp/config.h"
#endif
-#include "../webp/types.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/dsp/lossless.h b/drivers/webp/dsp/lossless.h
index ee6771333f..149c6a01d3 100644
--- a/drivers/webp/dsp/lossless.h
+++ b/drivers/webp/dsp/lossless.h
@@ -15,8 +15,8 @@
#ifndef WEBP_DSP_LOSSLESS_H_
#define WEBP_DSP_LOSSLESS_H_
-#include "../webp/types.h"
-#include "../webp/decode.h"
+#include "webp/types.h"
+#include "webp/decode.h"
#include "../enc/histogram.h"
#include "../utils/utils.h"
diff --git a/drivers/webp/enc/alpha.c b/drivers/webp/enc/alpha.c
index fad6346e43..1842b36401 100644
--- a/drivers/webp/enc/alpha.c
+++ b/drivers/webp/enc/alpha.c
@@ -19,7 +19,7 @@
#include "../utils/filters.h"
#include "../utils/quant_levels.h"
#include "../utils/utils.h"
-#include "../webp/format_constants.h"
+#include "webp/format_constants.h"
// -----------------------------------------------------------------------------
// Encodes the given alpha data via specified compression method 'method'.
diff --git a/drivers/webp/enc/backward_references.h b/drivers/webp/enc/backward_references.h
index daa084d846..e410b06f7d 100644
--- a/drivers/webp/enc/backward_references.h
+++ b/drivers/webp/enc/backward_references.h
@@ -15,8 +15,8 @@
#include <assert.h>
#include <stdlib.h>
-#include "../webp/types.h"
-#include "../webp/format_constants.h"
+#include "webp/types.h"
+#include "webp/format_constants.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/enc/config.c b/drivers/webp/enc/config.c
index f9f7961d58..8fd2276cb5 100644
--- a/drivers/webp/enc/config.c
+++ b/drivers/webp/enc/config.c
@@ -11,7 +11,7 @@
//
// Author: Skal (pascal.massimino@gmail.com)
-#include "../webp/encode.h"
+#include "webp/encode.h"
//------------------------------------------------------------------------------
// WebPConfig
diff --git a/drivers/webp/enc/delta_palettization.c b/drivers/webp/enc/delta_palettization.c
index 062e588d79..8bd3a3d233 100644
--- a/drivers/webp/enc/delta_palettization.c
+++ b/drivers/webp/enc/delta_palettization.c
@@ -13,7 +13,7 @@
#include "./delta_palettization.h"
#ifdef WEBP_EXPERIMENTAL_FEATURES
-#include "../webp/types.h"
+#include "webp/types.h"
#include "../dsp/lossless.h"
#define MK_COL(r, g, b) (((r) << 16) + ((g) << 8) + (b))
diff --git a/drivers/webp/enc/delta_palettization.h b/drivers/webp/enc/delta_palettization.h
index e41c0c5ab5..54195d452c 100644
--- a/drivers/webp/enc/delta_palettization.h
+++ b/drivers/webp/enc/delta_palettization.h
@@ -13,7 +13,7 @@
#ifndef WEBP_ENC_DELTA_PALETTIZATION_H_
#define WEBP_ENC_DELTA_PALETTIZATION_H_
-#include "../webp/encode.h"
+#include "webp/encode.h"
#include "../enc/vp8li.h"
// Replaces enc->argb_[] input by a palettizable approximation of it,
diff --git a/drivers/webp/enc/frame.c b/drivers/webp/enc/frame.c
index 5b7a40b9ad..65a98ada4d 100644
--- a/drivers/webp/enc/frame.c
+++ b/drivers/webp/enc/frame.c
@@ -17,7 +17,7 @@
#include "./cost.h"
#include "./vp8enci.h"
#include "../dsp/dsp.h"
-#include "../webp/format_constants.h" // RIFF constants
+#include "webp/format_constants.h" // RIFF constants
#define SEGMENT_VISU 0
#define DEBUG_SEARCH 0 // useful to track search convergence
diff --git a/drivers/webp/enc/histogram.c b/drivers/webp/enc/histogram.c
index 62c320d809..68c27fb1db 100644
--- a/drivers/webp/enc/histogram.c
+++ b/drivers/webp/enc/histogram.c
@@ -10,7 +10,7 @@
// Author: Jyrki Alakuijala (jyrki@google.com)
//
#ifdef HAVE_CONFIG_H
-#include "../webp/config.h"
+#include "webp/config.h"
#endif
#include <math.h>
diff --git a/drivers/webp/enc/histogram.h b/drivers/webp/enc/histogram.h
index adb16c01ca..72f045793a 100644
--- a/drivers/webp/enc/histogram.h
+++ b/drivers/webp/enc/histogram.h
@@ -17,8 +17,8 @@
#include <string.h>
#include "./backward_references.h"
-#include "../webp/format_constants.h"
-#include "../webp/types.h"
+#include "webp/format_constants.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/enc/syntax.c b/drivers/webp/enc/syntax.c
index a0e79ef404..2b65f15ca1 100644
--- a/drivers/webp/enc/syntax.c
+++ b/drivers/webp/enc/syntax.c
@@ -14,8 +14,8 @@
#include <assert.h>
#include "../utils/utils.h"
-#include "../webp/format_constants.h" // RIFF constants
-#include "../webp/mux_types.h" // ALPHA_FLAG
+#include "webp/format_constants.h" // RIFF constants
+#include "webp/mux_types.h" // ALPHA_FLAG
#include "./vp8enci.h"
//------------------------------------------------------------------------------
diff --git a/drivers/webp/enc/vp8enci.h b/drivers/webp/enc/vp8enci.h
index 1a7ebe5703..0cb2ccc353 100644
--- a/drivers/webp/enc/vp8enci.h
+++ b/drivers/webp/enc/vp8enci.h
@@ -20,7 +20,7 @@
#include "../utils/bit_writer.h"
#include "../utils/thread.h"
#include "../utils/utils.h"
-#include "../webp/encode.h"
+#include "webp/encode.h"
#ifdef WEBP_EXPERIMENTAL_FEATURES
#include "./vp8li.h"
diff --git a/drivers/webp/enc/vp8l.c b/drivers/webp/enc/vp8l.c
index 047c9032ac..284995e830 100644
--- a/drivers/webp/enc/vp8l.c
+++ b/drivers/webp/enc/vp8l.c
@@ -22,7 +22,7 @@
#include "../utils/bit_writer.h"
#include "../utils/huffman_encode.h"
#include "../utils/utils.h"
-#include "../webp/format_constants.h"
+#include "webp/format_constants.h"
#include "./delta_palettization.h"
diff --git a/drivers/webp/enc/vp8li.h b/drivers/webp/enc/vp8li.h
index 6b6db127db..4543c3b260 100644
--- a/drivers/webp/enc/vp8li.h
+++ b/drivers/webp/enc/vp8li.h
@@ -17,8 +17,8 @@
#include "./backward_references.h"
#include "./histogram.h"
#include "../utils/bit_writer.h"
-#include "../webp/encode.h"
-#include "../webp/format_constants.h"
+#include "webp/encode.h"
+#include "webp/format_constants.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/mux/anim_encode.c b/drivers/webp/mux/anim_encode.c
index fa86eaac94..bb7c0f50b9 100644
--- a/drivers/webp/mux/anim_encode.c
+++ b/drivers/webp/mux/anim_encode.c
@@ -15,10 +15,10 @@
#include <stdio.h>
#include "../utils/utils.h"
-#include "../webp/decode.h"
-#include "../webp/encode.h"
-#include "../webp/format_constants.h"
-#include "../webp/mux.h"
+#include "webp/decode.h"
+#include "webp/encode.h"
+#include "webp/format_constants.h"
+#include "webp/mux.h"
#if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf
diff --git a/drivers/webp/mux/muxi.h b/drivers/webp/mux/muxi.h
index 718b2f5d58..8bd5291661 100644
--- a/drivers/webp/mux/muxi.h
+++ b/drivers/webp/mux/muxi.h
@@ -17,7 +17,7 @@
#include <stdlib.h>
#include "../dec/vp8i.h"
#include "../dec/vp8li.h"
-#include "../webp/mux.h"
+#include "webp/mux.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/utils/bit_reader.c b/drivers/webp/utils/bit_reader.c
index cd265321bb..5081d5cd4d 100644
--- a/drivers/webp/utils/bit_reader.c
+++ b/drivers/webp/utils/bit_reader.c
@@ -12,7 +12,7 @@
// Author: Skal (pascal.massimino@gmail.com)
#ifdef HAVE_CONFIG_H
-#include "../webp/config.h"
+#include "webp/config.h"
#endif
#include "./bit_reader_inl.h"
diff --git a/drivers/webp/utils/bit_reader.h b/drivers/webp/utils/bit_reader.h
index 0fc62d33b7..7e09653ebc 100644
--- a/drivers/webp/utils/bit_reader.h
+++ b/drivers/webp/utils/bit_reader.h
@@ -19,7 +19,7 @@
#ifdef _MSC_VER
#include <stdlib.h> // _byteswap_ulong
#endif
-#include "../webp/types.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/utils/bit_reader_inl.h b/drivers/webp/utils/bit_reader_inl.h
index 37215702d4..20ce5f3cc7 100644
--- a/drivers/webp/utils/bit_reader_inl.h
+++ b/drivers/webp/utils/bit_reader_inl.h
@@ -17,7 +17,7 @@
#define WEBP_UTILS_BIT_READER_INL_H_
#ifdef HAVE_CONFIG_H
-#include "../webp/config.h"
+#include "webp/config.h"
#endif
#ifdef WEBP_FORCE_ALIGNED
diff --git a/drivers/webp/utils/bit_writer.h b/drivers/webp/utils/bit_writer.h
index ef360d1dc6..867a5ee055 100644
--- a/drivers/webp/utils/bit_writer.h
+++ b/drivers/webp/utils/bit_writer.h
@@ -14,7 +14,7 @@
#ifndef WEBP_UTILS_BIT_WRITER_H_
#define WEBP_UTILS_BIT_WRITER_H_
-#include "../webp/types.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/utils/color_cache.h b/drivers/webp/utils/color_cache.h
index a9a9f64270..34299e4c4e 100644
--- a/drivers/webp/utils/color_cache.h
+++ b/drivers/webp/utils/color_cache.h
@@ -15,7 +15,7 @@
#ifndef WEBP_UTILS_COLOR_CACHE_H_
#define WEBP_UTILS_COLOR_CACHE_H_
-#include "../webp/types.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/utils/endian_inl.h b/drivers/webp/utils/endian_inl.h
index e11260ff7d..253b7be8ee 100644
--- a/drivers/webp/utils/endian_inl.h
+++ b/drivers/webp/utils/endian_inl.h
@@ -13,11 +13,11 @@
#define WEBP_UTILS_ENDIAN_INL_H_
#ifdef HAVE_CONFIG_H
-#include "../webp/config.h"
+#include "webp/config.h"
#endif
#include "../dsp/dsp.h"
-#include "../webp/types.h"
+#include "webp/types.h"
// some endian fix (e.g.: mips-gcc doesn't define __BIG_ENDIAN__)
#if !defined(WORDS_BIGENDIAN) && \
diff --git a/drivers/webp/utils/filters.h b/drivers/webp/utils/filters.h
index 088b132fc5..4aba3fd3b7 100644
--- a/drivers/webp/utils/filters.h
+++ b/drivers/webp/utils/filters.h
@@ -14,7 +14,7 @@
#ifndef WEBP_UTILS_FILTERS_H_
#define WEBP_UTILS_FILTERS_H_
-#include "../webp/types.h"
+#include "webp/types.h"
#include "../dsp/dsp.h"
#ifdef __cplusplus
diff --git a/drivers/webp/utils/huffman.c b/drivers/webp/utils/huffman.c
index d57376aa6b..e6f482a6a8 100644
--- a/drivers/webp/utils/huffman.c
+++ b/drivers/webp/utils/huffman.c
@@ -16,7 +16,7 @@
#include <string.h>
#include "./huffman.h"
#include "../utils/utils.h"
-#include "../webp/format_constants.h"
+#include "webp/format_constants.h"
// Huffman data read via DecodeImageStream is represented in two (red and green)
// bytes.
diff --git a/drivers/webp/utils/huffman.h b/drivers/webp/utils/huffman.h
index c6dd6aaa45..a8cc0da1c3 100644
--- a/drivers/webp/utils/huffman.h
+++ b/drivers/webp/utils/huffman.h
@@ -15,8 +15,8 @@
#define WEBP_UTILS_HUFFMAN_H_
#include <assert.h>
-#include "../webp/format_constants.h"
-#include "../webp/types.h"
+#include "webp/format_constants.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/utils/huffman_encode.c b/drivers/webp/utils/huffman_encode.c
index 6421c2beed..d7aad6f56d 100644
--- a/drivers/webp/utils/huffman_encode.c
+++ b/drivers/webp/utils/huffman_encode.c
@@ -16,7 +16,7 @@
#include <string.h>
#include "./huffman_encode.h"
#include "../utils/utils.h"
-#include "../webp/format_constants.h"
+#include "webp/format_constants.h"
// -----------------------------------------------------------------------------
// Util function to optimize the symbol map for RLE coding
diff --git a/drivers/webp/utils/huffman_encode.h b/drivers/webp/utils/huffman_encode.h
index a157165148..93610066f3 100644
--- a/drivers/webp/utils/huffman_encode.h
+++ b/drivers/webp/utils/huffman_encode.h
@@ -14,7 +14,7 @@
#ifndef WEBP_UTILS_HUFFMAN_ENCODE_H_
#define WEBP_UTILS_HUFFMAN_ENCODE_H_
-#include "../webp/types.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/utils/quant_levels.h b/drivers/webp/utils/quant_levels.h
index 1cb5a32cae..3916b977ab 100644
--- a/drivers/webp/utils/quant_levels.h
+++ b/drivers/webp/utils/quant_levels.h
@@ -16,7 +16,7 @@
#include <stdlib.h>
-#include "../webp/types.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/utils/quant_levels_dec.h b/drivers/webp/utils/quant_levels_dec.h
index 9aab068076..29c7e6e205 100644
--- a/drivers/webp/utils/quant_levels_dec.h
+++ b/drivers/webp/utils/quant_levels_dec.h
@@ -14,7 +14,7 @@
#ifndef WEBP_UTILS_QUANT_LEVELS_DEC_H_
#define WEBP_UTILS_QUANT_LEVELS_DEC_H_
-#include "../webp/types.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/utils/random.h b/drivers/webp/utils/random.h
index c392a615ca..745f3e2e87 100644
--- a/drivers/webp/utils/random.h
+++ b/drivers/webp/utils/random.h
@@ -15,7 +15,7 @@
#define WEBP_UTILS_RANDOM_H_
#include <assert.h>
-#include "../webp/types.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/utils/rescaler.h b/drivers/webp/utils/rescaler.h
index 98b01a76d0..868467b4d7 100644
--- a/drivers/webp/utils/rescaler.h
+++ b/drivers/webp/utils/rescaler.h
@@ -18,7 +18,7 @@
extern "C" {
#endif
-#include "../webp/types.h"
+#include "webp/types.h"
#define WEBP_RESCALER_RFIX 32 // fixed-point precision for multiplies
#define WEBP_RESCALER_ONE (1ull << WEBP_RESCALER_RFIX)
diff --git a/drivers/webp/utils/thread.h b/drivers/webp/utils/thread.h
index 8408311855..6008bb7c01 100644
--- a/drivers/webp/utils/thread.h
+++ b/drivers/webp/utils/thread.h
@@ -15,10 +15,10 @@
#define WEBP_UTILS_THREAD_H_
#ifdef HAVE_CONFIG_H
-#include "../webp/config.h"
+#include "webp/config.h"
#endif
-#include "../webp/types.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {
diff --git a/drivers/webp/utils/utils.c b/drivers/webp/utils/utils.c
index d8e30930af..35aeae6ab8 100644
--- a/drivers/webp/utils/utils.c
+++ b/drivers/webp/utils/utils.c
@@ -13,8 +13,8 @@
#include <stdlib.h>
#include <string.h> // for memcpy()
-#include "../webp/decode.h"
-#include "../webp/encode.h"
+#include "webp/decode.h"
+#include "webp/encode.h"
#include "./utils.h"
// If PRINT_MEM_INFO is defined, extra info (like total memory used, number of
diff --git a/drivers/webp/utils/utils.h b/drivers/webp/utils/utils.h
index fcdb7e139b..d0e1cb250a 100644
--- a/drivers/webp/utils/utils.h
+++ b/drivers/webp/utils/utils.h
@@ -17,7 +17,7 @@
#include <assert.h>
-#include "../webp/types.h"
+#include "webp/types.h"
#ifdef __cplusplus
extern "C" {