存档

‘ACG’ 分类的存档

x264 Open-GOP/Infinite Keyint 测试

2010年8月2日

[本文首发于NMM视频基术论坛,地址]

x264最近的更新加入了两个关于keyframe的参数,–open-gop和–keyint infinite。
所谓open-gop,就是指允许类似IBBPBBIBB的frame结构,它的作用在于提高低keyint设置时的压缩率。
–keyint infinite的作用和open-gop正好相反,它为了最大化的利用压缩率存在的。开启infinite的open-gop后,除非scene-cut自动判定需要加入keyframe,一般情况下都不会加入keyframe。

众所周知,过于频繁的keyframe存在会降低压缩率,而一定频率的keyframe又能保证GOP间的B和P帧拥有良好的预测精度。同时keyframe的存在又保证了编码视频的可seek能力这在某些应用场合又是非常关键的。所以keyframe的选择是一个因人而异,因应用场合不同而变化的参数。

对于我们ripper来说,保证质量是优先考虑的,那么也许这两个参数,特别是infinite keyint,将对质量有一定帮助作用。于是我做了下面测试:

测试视频:ice,waterfall,ducks take off
分辨率:前两者CIF,后者720p

对SD序列我使用了600k的码率,对ducks这个特别吃码率的超级视频我使用了6000k的码率(即使这样QP也都大于30),RC使用的是2pass,除了这两者外其他参数都一致,并使用了我常用的参数配置。我试验了开启/关闭open-gop以及keyint使用常用设置(fpsx4)/infinite共四种组合。由于环境限制我没有用肉眼观看质量,只是使用了psnr和ssim两种质量模型,测试结果如下:

由于open-gop开启/keyint infinite与open-gop关闭/keyint infinite结果一模一样,所以不在列出了。这也可以理解,因为两者对keyframe的控制作用是完全相反的。

从上面的结果不难看出,开启open-gop保持现有keyint的设定,或者完全无视open-gop直接上极端的无穷keyint interval,都能对最终编码视频的质量有所提升(opengop的提升很有限)。至于两者选何者好就要根据实际编码视频的质量,以及可播放性来确定了,如果是极端ep的终极质量追求者,看片子几乎不seek,那就选择keyint infinite吧。

admin ACG, 不是A片的那个A, 技术宅区

[未完成+outdated]イドへ至る森へ至るイド意境小析

2010年6月17日

[本文藏于我的草稿夹里快一个月了,未完成且部分内容严重outdated,请读者自辨]

[十分感谢玖羽大大的歌词和译文,以及nico上的PV放出]

说来我有多长时间没写这种蛋疼歌词/物语分析文,我自己都记不太清楚了。大概从搬家到这个独立运营的blog来后就没有怎么写过这种东西了吧。这次Sound Horizon的前传式Maxi Single,很显然是为了今年秋冬的7th Story铺路的,也不知道是忍受了快两年毫无作品,四处live巡礼圈钱之后的新鲜劲,还是这部新作中由于3个臭皮匠的全面缺席而导致我本能的赞同这种行为的结果(喂),或者就干脆是这部纠结的旧世贵族乱伦黑暗剧意外的对我胃口吧。

下面就稍微展开说下这几天听イド我的一些理解和对故事情节的诠释吧。

首先看下错综复杂的家谱,我现在确定下来的,是Elise,Therese(又叫Anneliese)和Maerz三者的关系。这三者都是侯爵的子嗣,Therese最大,有可能是侯爵与原配夫人的女儿;由于Therese的美貌和善良,她与侯爵发生了父女的不伦之恋,并怀下了一个男孩,叫做Maerz。而Elise是在这之后,侯爵与后夫人生下的女儿。这三人的年龄关系是T>M>E,而且他们三人曾经有段时间同住在侯爵的宫殿内。

Maerz和Elise的相遇有两次,第一次是年幼的时候,当时Maerz还在侯爵的城堡里,而Elise自出生就被“幽禁”于深宫之中,第二曲中第一幕里所叙述的,就是他们第一次的相遇:幼年的Elise在犹如鸟笼般的深宫大院里,Maerz无意的闯入了她的生活圈子。第一次的相遇很简短,并且Elise当时并不知道Maerz是一个被诅咒的存在,是绝对不允许被察觉的侯爵乱伦之情的证据。之后,第二次的相遇在Maerz和他母亲Therese逃出宫殿隐居森林中之后,Elise因为重病被侯爵的后夫人送去森林中,而Therese就是当时被百姓称为的贤者。治病期间,Maerz和Elise再次相遇,Maerz带着Elise在森林中游玩,让Elise知道了广阔的世界。临走前,Elise与Maerz接吻了,并且Elise和Maerz约定,一定要让Maerz救她于深宫大院。值得注意的是,BK封面的Elise和Maerz牵着手,Elise抱着那个玩偶,但BK后面第二曲歌词中,Elise把那个玩偶作为契约之物送给了Maerz。从第一曲的PV中也可以看到,在之后黑死病爆发,Maerz把坏人引入家门,坏人把Maerz推入井下那一刻,他手上抱着的玩偶,就是之前一直在Elise手上的那只。

Maerz的母亲Therese,是一个心地善良的女孩,从Maerz小时候与Elise在城堡中相遇可以知道,Therese在于侯爵的乱伦之恋并生下Maerz后,仍在宫殿里住过一段时间。至于为何Therese被放逐,是她自己的原因,亦或是后夫人的逼迫,那就有待继续考察了。但明确的是,Therese之前的名字叫Anneliese,所以Maerz的姓,von Ludowing,一定是Anneliese的母亲也就是侯爵的原配,嫁入侯爵家,也就是von Wettin家之前的姓。第三曲中一开始,有一段Anneliese还在宫殿时,也许怀孕时,与侯爵的对话。可以想象Anneliese当时一定被软禁在某处,而从这段对话中:

「何故です。何故この子を公伯家の世継ぎとして迎えてくださらないのです…!」
「その話なら終わったはずだ」
「妾腹だから…いえ、この子の体が不自由だから」
「くどいぞ、アンネリーゼ」
「嗚呼…ごめんなさい。罪深き母…。あなたをそんな風に産んだこの母が悪いのです…」
「くどいと言っている!!」

不难看出侯爵对这个被诅咒的存在是毫不客气的,而Anneliese则认为无论怎么样,这个肚子里的孩子并没有错。
然后在第三曲开始前,T/A有一句这样自责自己的话:「Anneliese…あなたの気持ちは痛い程わかる。それでも私はあなたを赦さない…」
所以可以肯定的是,Therese和Anneliese应同为一人。A逃出后隐姓埋名成了Therese而已。

再返回到第二曲中,Elise对和Maerz相遇之后Maerz遭遇的不幸,说了这样一段话:

無明の刻の果てに 暴かれるままの
葦毛の馬の背なに 摇らされるままの
弱き存在

也就是说,在这之后,因为种种原因,Maerz随着母亲逃离了城堡,来到了森林中。
这个地方有个疑问,或者是矛盾之处,就是如果争吵发生于怀孕期间,那么显然侯爵本身是不愿意Maerz出身与宫殿的。那么Maerz又怎么可能在城堡里与Elise有了第一次的接触呢?

然后我们来看第三曲的主要部分,这里说的应该是逃出城堡的Maerz和隐姓埋名的母亲Therese生活的一段故事。在这里我们显而易见的是Maerz此时的眼睛应该是失明了的。如果是Maerz出生时眼睛就已经失明,那么Maerz又是如何与Elise发生第一次接触的呢?在此我倒是觉得有可能是在Maerz后来随母亲逃出城堡时因为外因后天失明的。但是也不排除这个失明的Maerz懵懂无知的与Elise最初相遇这个可能性的。

在森林中Therese对Maerz照顾有加,并且自己的医术也在逐渐提高,直到这个已经被当地人成为贤者的Therese的故事传到了城堡里,命运的齿轮又开始转动了:

这里值得注意的是,歌词中对重病Elise的形容,“もう息をしていなかった”,这是很决定性意味的陈述句。而从这个时间点以前,这个故事只是个很正常向的,没有超出我们这个世界构成的中世纪常见悲剧而已。但此处我觉得有某种恶魔契约一样的东西出现了,可以作为参考印证的歌词有几处,比如“救われる命があれば、奪われる命がある。それを因果応報と切り捨てても良いのだろうか……”,又比如第一曲中id和id手上那只叫Elise的人形的对话中的一句,“「殖えすぎかな?結局宿主を殺してしまうのよね、うふふ…」”。根据这些,其实可以假定Elise其实在送到T手中时早已断气(千里远在只有马车的中世纪需要多少天才能到达),而T或许通过某种….

admin ACG, 同人音乐, 音无小岛 , , ,

Metric Quality Comparison on x264 and VP8 Ref Encoder

2010年6月1日

As Google(formally On2) released its newest patent-free video coding standard, along with the HTML5 debate, people are generally interested with how this newest codec performances when comparing with existing video coding standard. While Google claimed VP8 is a good quality codec with low complexity, it looks like rather promising. For the application field like anime/movie subber, H.264 is a very acquainted for almost four years by the folks, and on the choice of encoder, x264 has been long established as the best yet free encoder everyone can used. So it is quite natural to think how the result would be when x264 encounters VP8’s encoder, this is the motivation that yields my following comparison.

Before we go through the benchmark stuff, the first thing I want to mention is the standard level comparison which has been done by the main developer of x264 few weeks ago. It is rather easy to reach a conclusion from his analysis that VP8 is in general inferior to the H.264. Jason predicted that VP8 will fall into the gap of baseline profile and high profile regarding the compression efficiency. But in complexity level, VP8 fails to deliver what Google said “low complexity” cause its tedious DCT approximation, chroma interpolation in motion estimation as well as loop filtering. In this comparison I didn’t analysis those differences in coding standard, rather to give readers a kind of intuitive quality performance by using some commonly used quality metrics.

So when we talk about actual encoder quality performance, an actual implementation of certain coding standard should be used. For H.264 we have no choice but x264, since it is very popular, it is the best among H.264 encoders, and it is free; for VP8 we still have no choice but VP8’s reference encoder, which is developed by On2.

And in this article I didn’t compare the encoding speed since this is another issue and it is more dependent on the actual implementation side.

OK, let’s start:

Methodology:

Sequences: city, crew, harbour, ice, soccer; all of them are retrieved from xiph.org
Spatial resolution: 4CIF, which is 704×576
Framerate: 30FPS constant
Bitrate: 500 through 3000, 500k as the interval
Encoder:
x264 I used rev 1612, I git’ed from x264 development tree and complie them in Ubuntu 9.04 environment.
VP8 I used the latest source code from WebM’s development tree.
Metrics: Average PSNR and SSIM, SSIM analysis is only based on Y channel.

Generally, I use x264 and VP8 generate its encoded bitstream, and for x264 I use –dump-yuv to get coded YUV sequences, for VP8 I use its ivfdec to get YUV sequences.

Coding Parameters:
Both of them I used two-pass scheme, x264 I use –placebo preset but didn’t use –slow-firstpass; VP8 I use the recommended parameter for best quality, you can find the manual here. I didn’t tune SSIM or PSNR in x264 to get an approximation of what we use practically. Detailed coding parameters are given as follows:

x264
1-pass

x264 --preset placebo --pass 1 --psnr --ssim --no-dct-decimate --bitrate $b --stats "$seq_name" --fps 29.97 --force-cfr -o NUL $seq_name 704x576

2-pass

x264 --preset placebo --pass 2 --psnr --ssim --no-dct-decimate --bitrate $b --stats "$seq_name" --fps 29.97 --force-cfr -o $coding_name $seq_name 704x576

VP8

ivfenc $seq_name $coding_name --i420 -w 704 -h 576 -p 2 -t 4 --best --target-bitrate=$b --end-usage=0 --auto-alt-ref=1 --timebase=1001/30000 --psnr --minsection-pct=5 --maxsection-pct=800 --lag-in-frames=16 --kf-min-dist=0 --kf-max-dist=360 --token-parts=2 --static-thresh=0 --drop-frame=0 --min-q=0 --max-q=60

The result are as follows:

WIthout doubt, when both at best possible quality mode, only from this not-yet-accurate metric measurments, x264 outperform VP8’s reference encoder by 2dB in PSNR and 0.025 in SSIM in average. This is not a marginal win since we often treat a 0.5dB improvement in PSNR as very good. In perceptual experiences, x264 looks way better for the retention of fine details while VP8 looks like more bias towards a smooth(blurring) result particularly in low bitrate(<1500k).

There are two sequences which VP8 got higher SSIM than x264, crew@500k and 1000k, ice@500k. In both cases, the scene can be described as “multiple persons with moderate to high in-scene motion”, maybe the smoother nature of VP8 will lead higher score than x264 particularly when bitrate is insufficient in this case. I am not quite sure about that, and it may also an indication that VP8 can be fitted better than H.264, for the low-bitrate application situation. Anyway, I am looking forward for a more sophisticated and better implementation of VP8 in near future.

admin ACG, 技术宅区 , ,

First Summer in Central Park

2010年5月25日

Happy Birthday, Lanya.

Can’t endure the lack of a tele lens since my old crappy Sigma 70-300mm has been traded for Tamron 70-300 of Pentax mount(well, for my girlfriend, personally I would prefer Tamron’s than Sigma’s after trying both.), I am looking around adorama’s used store to find some cheap but good ones to fill up the gap. I am kind of long waiting for a chance to get AFS 70-300 VR since it is said to be very fast and the actual output is fairly well, but the biggest problem is the budget, while I can’t simply afford those plastic toys which costs me some 500USD, both in money and in mind. So I am always looking for the good old days which may give me some lucky. Honestly speaking, Nikon does very good job for the compatibility issue on new DSLR with vintage lens. I have tried a AIS Micro-Nikkor 55mm/f3.5 sometime age and be surprised by the support of accurate metering and focus on my D200. From then on, I persuade myself with the mind that I should never go to those AFS ones unless I can earn more than 6000USD a month.

OK, today’s hero is AF 70-210mm f/4-5.6, which is an non-D version and I found it in Adorama. Firstly, it is very cheap, it costs me exactly 100USD after damning tax in NY, so I wouldn’t be on diet after buying this. And the most important thing is, as advertised on all review websites I visited, it is absolutely good. I like the the tone of this lens, and enjoy the sharpness only Nikon will give to you. I was at first been told by some reviews that maybe there is a very heavy ghost, flares and CA when using in the digital body, but after trying in a very extreme condition(against the sunlight, shoot the leaves and branches), I am totally satisfied with the performance it gives. And though there is no VR or ED in those good old days, and it is not constant aperture lens, but the MAX aperture is gorgeous and useful in the whole range. You can still get f/4 near 100mm, and f/4.2 near 135mm, I believe f/5 is up to near 185mm.

So I bring the lens to the central park, NYC is getting hotter those days and generally speaking the “official” summer should hit here in the first week of June. I shot almost all photos below with this 70-210mm.

Enjoy!

admin , 西域生活 , ,

喵喵喵的喵喵和喵喵

2010年5月24日

喵喵喵喵喵,喵喵,喵喵喵喵!

Valentina:呀~新买的皮鞋穿不进去~~~

Adrien:(叹气)。。。。。

admin ACG, ,

Switch to our mobile site