diff options
author | jstebbins <[email protected]> | 2012-08-27 18:05:13 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2012-08-27 18:05:13 +0000 |
commit | 0fa931ae3ea9d197fb305b0f49fae4a9b36c0c70 (patch) | |
tree | 1c9bd8c0f5c541fc41181453da06814a90f4ede8 /libhb/fifo.c | |
parent | 80987fa9a86baaddf5627bc4138070fb39b162ac (diff) |
libhb: decomb and deinterlace improvements
Use hb_buffer_t for reference buffers.
This is what eliminates extra buffer copies.
Simplified a lot of the code.
This resulted in some minor speed improvements and easier to read code.
Allow mcdeint+bob. Previously these could not be used together.
Thread the erode-dilate-erode-check steps in decomb3. More speed improvement.
Speed of default decomb went from 62fps to 76fps.
Speed of fast decomb went from 90fps to 95fps.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4919 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/fifo.c')
-rw-r--r-- | libhb/fifo.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libhb/fifo.c b/libhb/fifo.c index 13f361260..1f0d2ef97 100644 --- a/libhb/fifo.c +++ b/libhb/fifo.c @@ -366,7 +366,7 @@ void hb_buffer_reduce( hb_buffer_t * b, int size ) } } -hb_buffer_t * hb_buffer_copy( const hb_buffer_t * src ) +hb_buffer_t * hb_buffer_dup( const hb_buffer_t * src ) { hb_buffer_t * buf; @@ -386,6 +386,23 @@ hb_buffer_t * hb_buffer_copy( const hb_buffer_t * src ) return buf; } +int hb_buffer_copy(hb_buffer_t * dst, const hb_buffer_t * src) +{ + if (src == NULL || dst == NULL) + return -1; + + if ( dst->size < src->size ) + return -1; + + memcpy( dst->data, src->data, src->size ); + dst->s = src->s; + dst->f = src->f; + if (dst->s.type == FRAME_BUF) + hb_buffer_init_planes(dst); + + return 0; +} + static void hb_buffer_init_planes_internal( hb_buffer_t * b, uint8_t * has_plane ) { uint8_t * plane = b->data; |