Opened 13 years ago

Last modified 13 years ago

#1911 new defect

[PATCH] incorrect frame size used for Theora videos with frame size not multiple of 16

Reported by: dvdkhlng@… Owned by: reimar
Priority: normal Component: vd
Version: HEAD Severity: normal
Keywords: Cc: fy55dd2y82@…
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

Theora videos with frame-size not multiple 16 provide the display-size in theora_info::frame_{width,height}. vd_theora.c incorrectly uses theora_info::{width,height} so displays some padding colums/rows of garbage at the right and bottom side of the movie when playing back videos with dimensions not multiple of 16.

Here is an example video file (314x180, played back as 320x192):

http://mosquito.dyndns.tv/david/nanonote/theora-notx16.ogv

For vd_theora.c a simple 1-line patch is provided below. fftheora has the same problem, maybe somebody more experienced with ffmpeg could have a look at it?

cheers,

David

Attachments (2)

040-fix-theora-framesize-not-x16.patch (892 bytes ) - added by dvdkhlng@… 13 years ago.
patch to fix the problem for vd_theora.c
040-fix-theora-framesize-not-x16.2.patch (1.6 KB ) - added by dvdkhlng@… 13 years ago.
updated patch (need to honour theora_info::offset_{x,y} as well)

Download all attachments as: .zip

Change History (4)

by dvdkhlng@…, 13 years ago

patch to fix the problem for vd_theora.c

by dvdkhlng@…, 13 years ago

updated patch (need to honour theora_info::offset_{x,y} as well)

comment:1 by dvdkhlng@…, 13 years ago

attachments.isobsolete: 01

Updated the patch. theora_info also contains x,y offsets to crop at the left/top side of the image, so it effectively pads at all 4 borders when image size is not *16. Didn't look closely enough at the test video, else I'd have seen it.

I wonder whether the x, y members of the 'mp_image_t' struct can be put to use here? Computing byte offsets into the planes feels a little arkward.

comment:2 by fy55dd2y82@…, 13 years ago

Cc: fy55dd2y82@… added

(In reply to comment #1)

I wonder whether the x, y members of the 'mp_image_t' struct can be put to use
here? Computing byte offsets into the planes feels a little arkward.

FWIW, the reason libtheora does not do this directly is because of the case of odd offsets when the chroma planes are subsampled (which they normally are). Although the use of odd offsets in this case is officially discouraged, the correct behavior is to crop after converting to RGB (or anything else that is functionally equivalent).

Note: See TracTickets for help on using tickets.