diff options
author | jstebbins <[email protected]> | 2012-03-27 20:11:26 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2012-03-27 20:11:26 +0000 |
commit | 45b8f81a2e184e2b7deaf47afc49483766191a27 (patch) | |
tree | 30ed0892995cb4ad3255909f69269c453000800a /libhb/enctheora.c | |
parent | 7eb7737023be00fa0dc9be75a4984b80c0e5ce57 (diff) |
Rework filter pipeline
This patch enhances the filter objects. The 2 key improvements are:
1. A filter can change the image dimensions as frames pass through it.
2. A filter can output more than one frame.
In addition, I have:
Moved cropping & scalling into a filter object
Added 90 degree rotation to the rotate filter
Moved subtitle burn-in rendering to a filter object.
Moved VFR/CFR handling into a framerate shaping filter object.
Removed render.c since all it's responsibilities got moved to filters.
Improves VOBSUB and SSA subtitle handling. Allows subtitle animations.
SSA karaoke support.
My apologies in advance if anything breaks ;)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4546 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/enctheora.c')
-rw-r--r-- | libhb/enctheora.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libhb/enctheora.c b/libhb/enctheora.c index 20d532362..b4f3bb4be 100644 --- a/libhb/enctheora.c +++ b/libhb/enctheora.c @@ -319,16 +319,18 @@ int enctheoraWork( hb_work_object_t * w, hb_buffer_t ** buf_in, // Y ycbcr[0].width = frame_width; ycbcr[0].height = frame_height; - ycbcr[0].stride = job->width; // CbCr decimated by factor of 2 in both width and height ycbcr[1].width = ycbcr[2].width = (frame_width + 1) / 2; ycbcr[1].height = ycbcr[2].height = (frame_height + 1) / 2; - ycbcr[1].stride = ycbcr[2].stride = (job->width + 1) / 2; - ycbcr[0].data = in->data; - ycbcr[1].data = ycbcr[0].data + (ycbcr[0].stride * job->height); - ycbcr[2].data = ycbcr[1].data + (ycbcr[1].stride * ((job->height+1)/2)); + ycbcr[0].stride = in->plane[0].stride; + ycbcr[1].stride = in->plane[1].stride; + ycbcr[2].stride = in->plane[2].stride; + + ycbcr[0].data = in->plane[0].data; + ycbcr[1].data = in->plane[1].data; + ycbcr[2].data = in->plane[2].data; th_encode_ycbcr_in( pv->ctx, ycbcr ); @@ -358,9 +360,12 @@ int enctheoraWork( hb_work_object_t * w, hb_buffer_t ** buf_in, buf = hb_buffer_init( op.bytes + sizeof(op) ); memcpy(buf->data, &op, sizeof(op)); memcpy(buf->data + sizeof(op), op.packet, op.bytes); - buf->frametype = ( th_packet_iskeyframe(&op) ) ? HB_FRAME_KEY : HB_FRAME_REF; - buf->start = in->start; - buf->stop = in->stop; + buf->f.fmt = PIX_FMT_YUV420P; + buf->f.width = frame_width; + buf->f.height = frame_height; + buf->s.frametype = ( th_packet_iskeyframe(&op) ) ? HB_FRAME_KEY : HB_FRAME_REF; + buf->s.start = in->s.start; + buf->s.stop = in->s.stop; *buf_out = buf; |