On Sun, Jun 05, 2011 at 06:35:52PM -0400, Daniel Kang wrote:
> Parts are inspired from 8-bit H.264 predict code in Libav.
>
> Other parts ported from x264 with relicensing permission from author.
Queued, will push after FATE passes.
> --- a/libavcodec/x86/h264_intrapred_init.c
> +++ b/libavcodec/x86/h264_intrapred_init.c
> @@ -98,11 +123,8 @@ void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const
> uint8_t *topright, int s
> void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int
> bit_depth)
> {
> int mm_flags = av_get_cpu_flags();
> - const int high_depth = bit_depth > 8;
> -
> - if (high_depth)
> - return;
>
> + if (bit_depth == 8) {
> #if HAVE_YASM
> if (mm_flags & AV_CPU_FLAG_MMX) {
> h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_mmx;
> @@ -226,4 +248,35 @@ void ff_h264_pred_init_x86(H264PredContext *h, int
> codec_id, const int bit_depth
> }
> }
> #endif
> + } else if (bit_depth == 10) {
> +#if HAVE_YASM
> + if (mm_flags & AV_CPU_FLAG_MMX2) {
> + h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_10_mmxext;
> + h->pred4x4 [HOR_UP_PRED ] =
> ff_pred4x4_horizontal_up_10_mmxext;
> + }
This block is missing one level of indentation. It may make sense to
indent the first block in a separate patch (don't forget about it),
but the code you add should be correctly indented.
> + if (mm_flags & AV_CPU_FLAG_SSE2) {
> + h->pred4x4 [DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_10_sse2;
> + h->pred4x4 [DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_sse2;
> + h->pred4x4 [VERT_LEFT_PRED ] =
> ff_pred4x4_vertical_left_10_sse2;
> + h->pred4x4 [VERT_RIGHT_PRED ] =
> ff_pred4x4_vertical_right_10_sse2;
> + h->pred4x4 [HOR_DOWN_PRED ] =
> ff_pred4x4_horizontal_down_10_sse2;
The spaces before the [] look weird and it's not common style, not
even in this file, so please get rid of it.
> +#if HAVE_AVX
> + if (mm_flags&AV_CPU_FLAG_AVX) {
> + h->pred4x4 [DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_10_avx;
> + h->pred4x4 [DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_avx;
> + h->pred4x4 [VERT_RIGHT_PRED ] =
> ff_pred4x4_vertical_right_10_avx;
> + h->pred4x4 [HOR_DOWN_PRED ] =
> ff_pred4x4_horizontal_down_10_avx;
> + }
> +#endif
> +#endif
> + }
> }
extra good karma for commenting the #endifs, i.e.
#endif /* HAVE_AVX */
#endif /* HAVE_YASM */
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel