[PATCH] h264 luma interpolation 8x8 for altivec
Hi All, Here I'm sending a patch that adds support for luma interpolation of 8x8 blocks using Altivec. I have tested it on a G5 machine (Linux 2.6.15-1.2054_FC5, gcc 4.1.1) using some videos that I use for h264 research [1]). The resulting video files are md5 identical to the generated by the original ffmpeg. The execution time has been taken using the '-benchmark' option of ffmpeg over 5 runs of each video input: input orig. patched speed-up (%) (time in seconds) - 1088p25_blue_sky : 8,54 8,18 4,42 - 1088p25_pedestrian_area: 7,65 7,49 2,12 - 1088p25_riverbed : 10,66 10,39 2,59 - 1088p25_rush_hour : 8,23 8,05 2,21 Initially I assumed that the output array can have any misalignment (from 1 to 15), because of that is is necessary to include some code for generating two masks for permutating the final result. I made an analysis of this alignment and found that the destination result is always aligned, based on that it is possible to remove the re-alignment code at each store. I send a separate patch for this. Also It have been tested and the md5 check passed OK. Additionally I'm working on Altivec functions for doing the luma interpolation for non-square blocks: 16x8, 8x16, 8x4 and 4x8. The implementation of the functions is very easy. My question is how to integrate them with DSPContext structure. An option could be to add a position to the XXX_pixels_tab[][] structure, like this index | size 0: 16x16 1: 8x8 2: 4x4 3: 16x8 4: 8x16 5: 8x4 6: 4x8 the main problem is calling these functions. What is the best place for doing that? hl_motion? mc_dir_part? Suggestions on this issue are welcome. Regards, Mauricio
Mauricio Alvarez wrote:
Hi All,
Here I'm sending a patch that adds support for luma interpolation of 8x8 blocks using Altivec. I have tested it on a G5 machine (Linux 2.6.15-1.2054_FC5, gcc 4.1.1) using some videos that I use for h264 research [1]). The resulting video files are md5 identical to the generated by the original ffmpeg.
First, thank you for your effort.
I made an analysis of this alignment and found that the destination result is always aligned, based on that it is possible to remove the re-alignment code at each store. I send a separate patch for this. Also It have been tested and the md5 check passed OK.
Good
Additionally I'm working on Altivec functions for doing the luma interpolation for non-square blocks: 16x8, 8x16, 8x4 and 4x8. The implementation of the functions is very easy. My question is how to integrate them with DSPContext structure. An option could be to add a position to the XXX_pixels_tab[][] structure, like this index | size 0: 16x16 1: 8x8 2: 4x4 3: 16x8 4: 8x16 5: 8x4 6: 4x8
I'd like to know the opinion of the other people involved (x86 hackers I'm speacking to you ^^)
Suggestions on this issue are welcome.
Hm I'd like to comment your patches inlined but looks like my more than often idiotic client doesn't understand that text/* should be put inline... (hi thunderbird) first, the patch is about 700 lines, a bit big, so I'll be slow commenting, maybe you should try to split it in pieces.
+static void PREFIX_h264_qpel8_h_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) { + POWERPC_PERF_DECLARE(PREFIX_h264_qpel8_h_lowpass_num, 1);
DO you really use this? I'm actively deprecating it since last year and probably I'll remove it anytime soon if nobody screams, I think dtrace on macosx and oprofile on linux cover all our performance counting needs
\ static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){ \ - DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\ - put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\ + DECLARE_ALIGNED_16(uint8_t, half[16*16]);\ + put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, 16, stride);\ OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
doesn't look right
- if ( (unsigned long) dst & 0x0f) { ... + if (((unsigned long)dst) % 16 == 0) {
hm.. I guess that's all for now... -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
Hi On Mon, Jun 18, 2007 at 07:32:20PM +0200, Luca Barbato wrote: [...]
Additionally I'm working on Altivec functions for doing the luma interpolation for non-square blocks: 16x8, 8x16, 8x4 and 4x8. The implementation of the functions is very easy. My question is how to integrate them with DSPContext structure. An option could be to add a position to the XXX_pixels_tab[][] structure, like this index | size 0: 16x16 1: 8x8 2: 4x4 3: 16x8 4: 8x16 5: 8x4 6: 4x8
I'd like to know the opinion of the other people involved (x86 hackers I'm speacking to you ^^)
i do not think that these rectangular functions will speed the code up so we need benchmarks showing that iam wrong first ... these benchmarks MUST be done over the whole h264 decoder not just the MC code as the code will likely get slower due to code size / code cache issues [...]
first, the patch is about 700 lines, a bit big, so I'll be slow commenting, maybe you should try to split it in pieces.
seconded, always split patches when possible, it makes everyones life easier and very significantly speeds up review [...]
- if ( (unsigned long) dst & 0x0f) { ... + if (((unsigned long)dst) % 16 == 0) {
hm..
% and excessive () [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you really think that XML is the answer, then you definitly missunderstood the question -- Attila Kinali
Hi, On 6/18/07, Luca Barbato <lu_zero at gentoo.org> wrote:
Mauricio Alvarez wrote:
Hi All,
Here I'm sending a patch that adds support for luma interpolation of 8x8 blocks using Altivec.
first, the patch is about 700 lines, a bit big, so I'll be slow
commenting, maybe you should try to split it in pieces.
OK, I divided the patch in different parts. part1: cosmetics: replace all the variable definitions in h264_altivec.c and h264_template_altivec.c with the data types defined in types_altivec.h including the use of the LOAD_ZERO and the corresponding zero_xxxxv definitions. part2: removes alignment correction of the destination pointers in luma_16x6 interpolations. As I mentioned before I have made a test and these pointers are always aligned to 128-bit- The only source of misalignment (with respect to 128-bit) is the variable block size, but in the 16x16 case the destination is always aligned. part3. add luma_8x8 interpolation routines. I made a complete patch for this. This functions are very similar to the 16x16 ones, but taking into account the alignment of the 8x8 cases and other minor details.
+static void PREFIX_h264_qpel8_h_lowpass_altivec(uint8_t * dst,
uint8_t * src, int dstStride, int srcStride) { + POWERPC_PERF_DECLARE(PREFIX_h264_qpel8_h_lowpass_num, 1);
DO you really use this? I'm actively deprecating it since last year and probably I'll remove it anytime soon if nobody screams, I think dtrace on macosx and oprofile on linux cover all our performance counting needs
I'm not using these functions for profiling, So, I have not included them in the new patch.
\
static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){ \ - DECLARE_ALIGNED_16(uint8_t, half[SIZE*SIZE]);\ - put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\ + DECLARE_ALIGNED_16(uint8_t, half[16*16]);\ + put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, 16, stride);\ OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
doesn't look right
Well, the possible values of SIZE are 16 and 8 (for Altivec), but in both cases we have to perform loads (and stores) in the temporary arrays of 16 bytes. Because of that I replaced uint8_t, half[SIZE*SIZE] by uint8_t, half[16*16]. In this way we avoid to perform extra alignment checks in the 8x8 case.
- if ( (unsigned long) dst & 0x0f) { ...
+ if (((unsigned long)dst) % 16 == 0) {
hm..
that, was corrected. I guess that's all for now... Thanks for your comments, Mauricio
Mauricio Alvarez wrote:
part1: cosmetics: replace all the variable definitions in h264_altivec.c and h264_template_altivec.c with the data types defined in types_altivec.h including the use of the LOAD_ZERO and the corresponding zero_xxxxv definitions.
Seems ok
part2: removes alignment correction of the destination pointers in luma_16x6 interpolations. As I mentioned before I have made a test and these pointers are always aligned to 128-bit- The only source of misalignment (with respect to 128-bit) is the variable block size, but in the 16x16 case the destination is always aligned.
Ok
part3. add luma_8x8 interpolation routines. I made a complete patch for this. This functions are very similar to the 16x16 ones, but taking into account the alignment of the 8x8 cases and other minor details.
Please add a comment just in case. It's unlikely that we'd have cpus with VMX with larger vectors but better be safe. part3 Ok part4 Seems ok, maybe make it fit 79cols That's all from a quick read of the code, I'll test it soon. lu -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
Hello, On 6/26/07, Luca Barbato <lu_zero at gentoo.org> wrote:
Mauricio Alvarez wrote:
part2: removes alignment correction of the destination pointers in luma_16x6 interpolations. As I mentioned before I have made a test and these pointers are always aligned to 128-bit- The only source of misalignment (with respect to 128-bit) is the variable block size, but in the 16x16 case the destination is always aligned.
Ok
If in all cases these IMHO, it would be a good idea to add a code to allow an easy test of these alignment thingies in case we need to do some debug. I'd like to add smth like this #ifdef DEBUG_ALIGNMENT #define ASSERT_ALIGNED(ptr) assert(!((unsigned long)ptr&0x0000000F)); #else ASSERT_ALIGNED(ptr) 0; #endif and add ASSERT_ALIGNED() wherever we were handling unaligned memory accesses. That way, if for some reason a user experiences corruptions, we can advise him to test for alignment by defining DEBUG_ALIGNMENT. So, what do you guys think? Guillaume -- A soldier will fight long and hard for a bit of colored ribbon. -- Napoleon Bonaparte
Hi, On 8/12/07, Guillaume POIRIER <poirierg at gmail.com> wrote:
IMHO, it would be a good idea to add a code to allow an easy test of these alignment thingies in case we need to do some debug.
I'd like to add smth like this #ifdef DEBUG_ALIGNMENT #define ASSERT_ALIGNED(ptr) assert(!((unsigned long)ptr&0x0000000F)); #else ASSERT_ALIGNED(ptr) 0; #endif
and add ASSERT_ALIGNED() wherever we were handling unaligned memory accesses.
That way, if for some reason a user experiences corruptions, we can advise him to test for alignment by defining DEBUG_ALIGNMENT.
So, what do you guys think?
Like in attached patch... Does this look reasonable? Guillaume -- A soldier will fight long and hard for a bit of colored ribbon. -- Napoleon Bonaparte
Guillaume POIRIER wrote:
Hi,
On 8/12/07, Guillaume POIRIER <poirierg at gmail.com> wrote:
IMHO, it would be a good idea to add a code to allow an easy test of these alignment thingies in case we need to do some debug.
I'd like to add smth like this #ifdef DEBUG_ALIGNMENT #define ASSERT_ALIGNED(ptr) assert(!((unsigned long)ptr&0x0000000F)); #else ASSERT_ALIGNED(ptr) 0; #endif
and add ASSERT_ALIGNED() wherever we were handling unaligned memory accesses.
That way, if for some reason a user experiences corruptions, we can advise him to test for alignment by defining DEBUG_ALIGNMENT.
So, what do you guys think?
Like in attached patch...
Does this look reasonable?
1/16 you'd get things as you expect even if they are wrong. It isn't exactly something I'd use. lu -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
Hi, On 8/25/07, Luca Barbato <lu_zero at gentoo.org> wrote:
Guillaume POIRIER wrote:
Hi,
On 8/12/07, Guillaume POIRIER <poirierg at gmail.com> wrote:
IMHO, it would be a good idea to add a code to allow an easy test of these alignment thingies in case we need to do some debug.
I'd like to add smth like this #ifdef DEBUG_ALIGNMENT #define ASSERT_ALIGNED(ptr) assert(!((unsigned long)ptr&0x0000000F)); #else ASSERT_ALIGNED(ptr) 0; #endif
and add ASSERT_ALIGNED() wherever we were handling unaligned memory accesses.
That way, if for some reason a user experiences corruptions, we can advise him to test for alignment by defining DEBUG_ALIGNMENT.
So, what do you guys think?
Like in attached patch...
Does this look reasonable?
1/16 you'd get things as you expect even if they are wrong. It isn't exactly something I'd use.
So no assert or guards at all, just the original patch? Guillaume -- A soldier will fight long and hard for a bit of colored ribbon. -- Napoleon Bonaparte
Guillaume POIRIER wrote:
So no assert or guards at all, just the original patch?
Rereading I see your point, better a broken diagnostic with just false negative from time to time than anything at all. We shouldn't rely on it to verify this code, but if we expect to be ok for linux/macosx but MAY fail for unknown reasons then it has somewhat more sense. I expect to not fail on standard setups... lu -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
Hi, On 8/26/07, Luca Barbato <lu_zero at gentoo.org> wrote:
Guillaume POIRIER wrote:
So no assert or guards at all, just the original patch?
Rereading I see your point, better a broken diagnostic with just false negative from time to time than anything at all.
We shouldn't rely on it to verify this code, but if we expect to be ok for linux/macosx but MAY fail for unknown reasons then it has somewhat more sense. I expect to not fail on standard setups...
Exactly. Now tell me explicitly what to do with this patch: should the original version or my version be applied? Guillaume -- A soldier will fight long and hard for a bit of colored ribbon. -- Napoleon Bonaparte
Guillaume POIRIER wrote:
Hi,
On 8/26/07, Luca Barbato <lu_zero at gentoo.org> wrote:
Guillaume POIRIER wrote:
So no assert or guards at all, just the original patch? Rereading I see your point, better a broken diagnostic with just false negative from time to time than anything at all.
We shouldn't rely on it to verify this code, but if we expect to be ok for linux/macosx but MAY fail for unknown reasons then it has somewhat more sense. I expect to not fail on standard setups...
Exactly. Now tell me explicitly what to do with this patch: should the original version or my version be applied?
Your version. -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
Hi, On 8/26/07, Luca Barbato <lu_zero at gentoo.org> wrote:
Guillaume POIRIER wrote:
Hi,
On 8/26/07, Luca Barbato <lu_zero at gentoo.org> wrote:
Guillaume POIRIER wrote:
So no assert or guards at all, just the original patch? Rereading I see your point, better a broken diagnostic with just false negative from time to time than anything at all.
We shouldn't rely on it to verify this code, but if we expect to be ok for linux/macosx but MAY fail for unknown reasons then it has somewhat more sense. I expect to not fail on standard setups...
Exactly. Now tell me explicitly what to do with this patch: should the original version or my version be applied?
Your version.
Good, applied. Guillaume -- A soldier will fight long and hard for a bit of colored ribbon. -- Napoleon Bonaparte
Hi, On 6/26/07, Luca Barbato <lu_zero at gentoo.org> wrote:
Mauricio Alvarez wrote:
part3. add luma_8x8 interpolation routines. I made a complete patch for this. This functions are very similar to the 16x16 ones, but taking into account the alignment of the 8x8 cases and other minor details.
Please add a comment just in case. It's unlikely that we'd have cpus with VMX with larger vectors but better be safe.
part3 Ok
part4 Seems ok, maybe make it fit 79cols
That's all from a quick read of the code, I'll test it soon.
Part 3 doesn't apply anymore, here's an updated patch that applies to current GIT tree ,-) Guillaume -- A soldier will fight long and hard for a bit of colored ribbon. -- Napoleon Bonaparte
Guillaume POIRIER wrote:
Part 3 doesn't apply anymore, here's an updated patch that applies to current GIT tree ,-)
Could you apply the SIZE -> 16 separately or just remove it? lu -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
Hi, Luca Barbato wrote:
Guillaume POIRIER wrote:
Part 3 doesn't apply anymore, here's an updated patch that applies to current GIT tree ,-)
Could you apply the SIZE -> 16 separately or just remove it?
Yes, I can apply it separately, but not remove it. Quoting Mauricio Alvarez: "Well, the possible values of SIZE are 16 and 8 (for Altivec), but in both cases we have to perform loads (and stores) in the temporary arrays of 16 bytes. Because of that I replaced uint8_t, half[SIZE*SIZE] by uint8_t, half[16*16]. In this way we avoid to perform extra alignment checks in the 8x8 case." This seems like a reasonable reason to do the SIZE -> 16, don't you think? Guillaume
Guillaume Poirier wrote:
This seems like a reasonable reason to do the SIZE -> 16, don't you think?
SIZE -> VECTOR_SIZE (always 16) My point was to keep that code ready for furter possible changes in vector size. Anyway it's a minor thing, just committing the change in a separate patch is fine for me. lu -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
Hello, On Wed, Aug 29, 2007 at 1:10 AM, Luca Barbato <lu_zero at gentoo.org> wrote:
Guillaume Poirier wrote:
This seems like a reasonable reason to do the SIZE -> 16, don't you think?
SIZE -> VECTOR_SIZE (always 16)
My point was to keep that code ready for furter possible changes in vector size. Anyway it's a minor thing, just committing the change in a separate patch is fine for me.
I saw Mauricio Alvarez at l'Aquila, at ACACES summer school, and as we talked together, he reminded me that he worked on Altivec routines, which I couldn't figure if they had got it. Turns out that they had gone out of my radar. Here's his patch split in 2 parts: part3_luma8x8.3.diff has the new luma8x8 routines vector_size_is_16.diff tries to make it more explicit that SIZE in fact always equal to 16. I can't currently test these patches since I'm enjoying the Italian sun at the moment, so if someone wants to give it a try before I get back home, in a week, feel free to do so and report. Cheers, Guillaume -- Bill Cosby - "Advertising is the most fun you can have with your clothes on."
Hello, On Wed, Jul 16, 2008 at 6:20 PM, Guillaume POIRIER <poirierg at gmail.com> wrote:
I saw Mauricio Alvarez at l'Aquila, at ACACES summer school, and as we talked together, he reminded me that he worked on Altivec routines, which I couldn't figure if they had got it. Turns out that they had gone out of my radar.
Here's his patch split in 2 parts:
part3_luma8x8.3.diff has the new luma8x8 routines
Here's a patch that applies cleanly to the current tree (the recent cosmetic commit broke that patch). I didn't change the the new code to make it blend in the Diego's style, but will eventually do it before checking it in. I'm back home now (all tanned!), so I shall test this patch thoroughly in the coming days. Guillaume -- Mitch Hedberg - "My fake plants died because I did not pretend to water them."
On Tue, Jul 22, 2008 at 11:25 PM, Guillaume POIRIER <poirierg at gmail.com> wrote:
Hello,
On Wed, Jul 16, 2008 at 6:20 PM, Guillaume POIRIER <poirierg at gmail.com> wrote:
I saw Mauricio Alvarez at l'Aquila, at ACACES summer school, and as we talked together, he reminded me that he worked on Altivec routines, which I couldn't figure if they had got it. Turns out that they had gone out of my radar.
Here's his patch split in 2 parts:
part3_luma8x8.3.diff has the new luma8x8 routines
Here's a patch that applies cleanly to the current tree
Ahem... -- James Thurber - "Women are wiser than men because they know less and understand more."
Hello, On Jul 22, 2008, at 11:26 , Guillaume POIRIER wrote:
On Tue, Jul 22, 2008 at 11:25 PM, Guillaume POIRIER <poirierg at gmail.com> wrote:
Hello,
On Wed, Jul 16, 2008 at 6:20 PM, Guillaume POIRIER <poirierg at gmail.com> wrote:
I saw Mauricio Alvarez at l'Aquila, at ACACES summer school, and as we talked together, he reminded me that he worked on Altivec routines, which I couldn't figure if they had got it. Turns out that they had gone out of my radar.
Here's his patch split in 2 parts:
part3_luma8x8.3.diff has the new luma8x8 routines
Here's a patch that applies cleanly to the current tree
Ahem...
Ok, I finally had time to sit down and test the latest known incarnation of the third part of Mauricio's patch. Compared to yesterday's patch, I had to fix fix the code so that it uses newer syntax of LD32()'s macro. Since the patch didn't allow lavc to decode my samples correctly, I went back to Mauricio's latest known 3rd patch of his patchset, to find out that I had made a mistake in an intermediate version of these ported patches. Attached is Mauricio's patch ported to current SVN (so it features the "SIZE" => "16" change, which I believe doesn't change anything regarding the correctness of the output). Here's what lavc has to say when I try to decode a sample with it: [h264 @ 0x6f8970]number of reference frames exceeds max (probably corrupt input), discarding one [h264 @ 0x6f8970]number of reference frames exceeds max (probably corrupt input), discarding one [....] Mauricio, could you have a look of what's wrong with your patch? If you don't, this patch may rot on my computer for a while.... Guillaume
Hello, 2008/7/23 Guillaume Poirier <gpoirier at mplayerhq.hu>:
On Jul 22, 2008, at 11:26 , Guillaume POIRIER wrote: Ok, I finally had time to sit down and test the latest known incarnation of the third part of Mauricio's patch. Compared to yesterday's patch, I had to fix fix the code so that it uses newer syntax of LD32()'s macro.
Since the patch didn't allow lavc to decode my samples correctly, I went back to Mauricio's latest known 3rd patch of his patchset, to find out that I had made a mistake in an intermediate version of these ported patches.
Attached is Mauricio's patch ported to current SVN (so it features the "SIZE" => "16" change, which I believe doesn't change anything regarding the correctness of the output).
Here's what lavc has to say when I try to decode a sample with it: [h264 @ 0x6f8970]number of reference frames exceeds max (probably corrupt input), discarding one [h264 @ 0x6f8970]number of reference frames exceeds max (probably corrupt input), discarding one [....]
Mauricio, could you have a look of what's wrong with your patch? If you don't, this patch may rot on my computer for a while....
Guillaume
It appears that this problem wasn't due to Mauricio's patch, but was due to a change in h264.c. I did an md5sum diff between the video output of patched and unpatched output, and it's not identical, as in the diff shows: diff -u md5sums* --- md5sums 2008-07-25 13:52:19.000000000 +0200 +++ md5sums.new 2008-07-25 13:45:28.000000000 +0200 @@ -145,15 +145,15 @@ e0efe308955bb1b4ff9cfbb74968db3e frame00000144 a93ccb4da8cba3b9dadd806c40933ed5 frame00000145 fae0d64f7798b9bfa59946c8084c327e frame00000146 -57b411b97e9e87d36a71a238a233c207 frame00000147 +02eb6c61f922a50ed880c9b0a43fdd80 frame00000147 4bead55cbe7b078049df25ac4b489626 frame00000148 c1e35cbafaa2911053f84d87f74650c4 frame00000149 d75a9b01c5ea100219d98569f27c2bf2 frame00000150 c7df21114aaa16907ad2991488f61d54 frame00000151 05b171c71151c1b587445ec636367e26 frame00000152 f02f1ddce391025e71c51067fb34e1bd frame00000153 -9863c4ebbd8a32fe155f7440b4d27c07 frame00000154 -3ca120bce7e48289f958afe229f0252d frame00000155 +5412191453eb6872fc4ca29a8a0cd811 frame00000154 +5dcb0ef2a6f81f1c305d44a84eeaff57 frame00000155 8ab9338bb576dcfd70f200987321fa95 frame00000156 20d90b1ca86db1e6403a3b08a14dd2eb frame00000157 26e85517a41c0248c45c093f2b19410f frame00000158 @@ -424,7 +424,7 @@ 7d30672495b4b3b13cffecaee26d8f33 frame00000423 269bedccee08037e655435024b6fffc3 frame00000424 4defb5ab01944c174a529990367cd354 frame00000425 -c0737991a94098d65a998f22258978c3 frame00000426 +fbb8a211711800f4d1d2e231913b139c frame00000426 27989b3b117144c59c020afef4737424 frame00000427 3113f3bcc9b38e5678b2774b8f6a8374 frame00000428 0faec4ba6d2538f3e72ca7d31975d7e0 frame00000429 Mauricio, are you reading this mailing list at all these days? Guillaume -- Charles Dickens - "He would make a lovely corpse."
On 7/25/08, Guillaume POIRIER <gpoirier at mplayerhq.hu> wrote:
Mauricio, are you reading this mailing list at all these days?
I have been on vacations for some weeks. I'm still out of my work. But I'll try to review the patch and see where is the problem, Regards, Mauricio Guillaume
-- Charles Dickens - "He would make a lovely corpse."
Hi, I'd prefer if all comments on top of the functions could match the name of the parameters: Mauricio Alvarez wrote:
--- libavcodec/ppc/h264_template_altivec.c 2007-06-26 12:30:40.000000000 +0200 +++ /home/alvarez/turandot_simulation/media_tools/src/ffmpeg/libavcodec/ppc/h264_template_altivec.c 2007-06-26 12:10:24.000000000 +0200 @@ -634,3 +634,413 @@ static void PREFIX_h264_qpel16_hv_lowpas } POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_hv_lowpass_num, 1); } + +/* this code assumes stride % 16 == 0 and dst is aligned to 64 bits */ +static void PREFIX_h264_qpel8_h_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
Does that mean that both dstStride and srcStride need to ensure % 16 == 0? It's better if you specify it.
+/* this code assume stride % 16 == 0 and and dst is aligned to 64 bits */ +static void PREFIX_h264_qpel8_v_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) {
here too
+/* this code assume stride % 16 == 0 *and* tmp is properly aligned *and* dst is aligned to 64-bits */ +static void PREFIX_h264_qpel8_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, uint8_t * src, int dstStride, int tmpStride, int srcStride) {
and here.... note that this time there's 3 strides Guillaume
Hi, Mauricio Alvarez wrote:
OK, I divided the patch in different parts.
part1: cosmetics: replace all the variable definitions in h264_altivec.c and h264_template_altivec.c with the data types defined in types_altivec.h including the use of the LOAD_ZERO and the corresponding zero_xxxxv definitions.
That part is OK to me, except that you don't keep the end of the lines ('\') of macros properly aligned. It's more pleasant to my eye when everything is properly aligned. No a big deal, especially if it breaks the series of patches you posted. Guillaume
On 6/26/07, Guillaume Poirier <gpoirier at mplayerhq.hu> wrote:
Hi,
Mauricio Alvarez wrote:
OK, I divided the patch in different parts.
part1: cosmetics: replace all the variable definitions in h264_altivec.c and h264_template_altivec.c with the data types defined in types_altivec.h including the use of the LOAD_ZERO and the corresponding zero_xxxxv definitions.
That part is OK to me, except that you don't keep the end of the lines ('\') of macros properly aligned.
Fixed, this is a cosmetic patch, and such kind of details should be OK. Mauricio
Mauricio Alvarez wrote:
On 6/26/07, Guillaume Poirier <gpoirier at mplayerhq.hu> wrote:
Hi,
Mauricio Alvarez wrote:
OK, I divided the patch in different parts.
part1: cosmetics: replace all the variable definitions in h264_altivec.c and h264_template_altivec.c with the data types defined in types_altivec.h including the use of the LOAD_ZERO and the corresponding zero_xxxxv definitions.
That part is OK to me, except that you don't keep the end of the lines ('\') of macros properly aligned.
Fixed, this is a cosmetic patch, and such kind of details should be OK.
Mauricio ------------------------------------------------------------------------
Index: libavcodec/ppc/h264_template_altivec.c =================================================================== --- libavcodec/ppc/h264_template_altivec.c (revision 9431) +++ libavcodec/ppc/h264_template_altivec.c (working copy) @@ -1,4 +1,4 @@ -/* + /*
oops ? :) Ben
Hi, On 6/26/07, Mauricio Alvarez <lokifo at gmail.com> wrote:
On 6/26/07, Guillaume Poirier <gpoirier at mplayerhq.hu> wrote:
Hi,
Mauricio Alvarez wrote:
OK, I divided the patch in different parts.
part1: cosmetics: replace all the variable definitions in h264_altivec.c and h264_template_altivec.c with the data types defined in types_altivec.h including the use of the LOAD_ZERO and the corresponding zero_xxxxv definitions.
That part is OK to me, except that you don't keep the end of the lines ('\') of macros properly aligned.
Fixed, this is a cosmetic patch, and such kind of details should be OK.
You missed a few. Attached patch should have them all these issues fixed. Luca, are you OK with this patch? Guillaume -- Subversion has been the most pointless project ever started -- Linus Torvalds
Guillaume POIRIER wrote:
Luca, are you OK with this patch?
Looks fine, did you try it already? (I'm building it right now) lu -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
Hi, On 6/26/07, Luca Barbato <lu_zero at gentoo.org> wrote:
Guillaume POIRIER wrote:
Luca, are you OK with this patch?
Looks fine, did you try it already? (I'm building it right now)
I only tried to compile it: it's supposed to be a cosmetics-only patch (and yeah, I know it's not proper testing) ;-) No, no, I didn't test part1, just fixed the indentation. Guillaume -- Subversion has been the most pointless project ever started -- Linus Torvalds
Hi, On 6/26/07, Guillaume POIRIER <poirierg at gmail.com> wrote:
Hi,
On 6/26/07, Luca Barbato <lu_zero at gentoo.org> wrote:
Guillaume POIRIER wrote:
Luca, are you OK with this patch?
Looks fine, did you try it already? (I'm building it right now)
I only tried to compile it: it's supposed to be a cosmetics-only patch (and yeah, I know it's not proper testing) ;-)
No, no, I didn't test part1, just fixed the indentation.
Ok, part 1 applied. This was long overdue. Let's now look at the other parts of the patchset. Guillaume -- A soldier will fight long and hard for a bit of colored ribbon. -- Napoleon Bonaparte
Guillaume POIRIER wrote:
Let's now look at the other parts of the patchset.
I vaguely recalled I had something to test&apply... good you recalled before me =) lu -- Luca Barbato Gentoo/linux Gentoo/PPC http://dev.gentoo.org/~lu_zero
participants (7)
-
alvarez@ac.upc.edu -
benoit.fouet@purplelabs.com -
gpoirier@mplayerhq.hu -
lokifo@gmail.com -
lu_zero@gentoo.org -
michaelni@gmx.at -
poirierg@gmail.com